Anil's Blog is Best Viewed on GOOGLE CHROME

Saturday, August 20, 2011

HelloWorld Page in ADF


Building HelloWorld Page in ADF Application


1.       Choose Application à New from the main menu and select Fusion Web Application (ADF) from Application Template.

Enter HelloWorld in the Application Name and in the Application Package Prefix enter:
Demo.adf.helloworld


Click Finish.

You will see Model and ViewController gets created in HelloWorld application. Now click on ViewController and choose New

1.       Navigate to Web Tierà JSFà and choose JSF Page from the Items list.



Enter “HelloWorld.jspx” in the File Name. Make sure that Blank Page is selected under Initial Page Layout and Content and under Page Implementation automatically expose managed bean is selected


Drag Decorative Box from the Layout option available in the Component Palate

Drag item of type Input Text*, Button* on the center facet and Output Text* on the top of the decorative box.

* Available under Common Components.


After this click on af:panelGroupLayout – scroll under center facet of af:decorativeBox and go to property pallete.

Set Halign = center. Repeat the same for af:panelGroupLayout – scroll under top facet af:decorativeBox.
  
Now double click on Go Button created on HelloWorld.jspx that opens the Bind Action property window as shown below.


Now write below code in above created method i.e.HandleGoBtn in backing bean.
public String HandleGoBtn() {
        // Add event code here...
        RichInputText inputText = getIt1();
        String name = "Hello "+(String)inputText.getValue()+ "!!";
        ot1.setValue(name);
        return null;
    }

Save All and run the page by right  clicking on HelloWorld.jspx and select run.

You may download the application from here

Thanks
--Anil