1) Click on new Application in the Application Navigator ...



Click on new Application in the Application Navigator window and then

Select FusionWebApplication (ADF) as option and click next

[pic]

2) Then again click next again next for model project again next for ViewControllor project and click finish.

[pic]

[pic]

[pic]

3) Now we got Model and ViewController Projects in our example Application.

[pic]

4) Right click on ViewController project and select New option then we will getting one dialog to select JSF as one option from categories and select JSF page from Items and click OK

[pic]

[pic]

5) Give Name as AdditionNumbers to JSPX file.

[pic]

6) Select “Create as XML Document” check box and click OK button

[pic]

7) Now we got AdditionNumbers.jspx created in our ViewController project then we need to add three input text components and one Button component from Component Palette

8) Choose Source option of AdditionNumbers.jspx file.

[pic]

9) we need to add our 4 components with in the tag

[pic]

10) Now click on 4th icon (Save all option ) from main menu to save all the items.

11) Modify Labels as First Number and Second Number and Addition for three text boxes and modify command button text value as Submit and press Contrl+S to save our work.

[pic]

12) We need to create java file to do addition operation and bind three values.

13) Right click on ViewController project and select New option

[pic]

14) After that select Java from categories and choose Java Class from items then click on OK button .

[pic]

15) Give Name as Addition to our java class and press OK button.

[pic]

16) Now we need to add three variables as int data type and add one method to our class

[pic]

17) Below are the three variables

private int a;

private int b;

private int c;

and create setters and getters to our java file through Generate Accessors option .

For this we need to right click on java class and select Generate Accessors option

[pic]

18) And click on Select All button

[pic]

19) Now we got all the setters/getters in java file.

[pic]

20) Press control+S to save all work and open adfc-config.xml file under ViewController ( WebContent( WEB-INF ( adfc-config.xml

[pic]

21) Then goto overview tab from bottom of the adfc-config.xml.

[pic]

22) then goto Managed Beans and click green + symbol to add our managed bean.

[pic]

23) Please give name as mbean and class as Addition and scope is session

[pic]

[pic]

24) Please press control+S to save all our activities in Jdeveloper. Now we need to bind three variables (a,b,c) to our three text boxes.

Open property Inspector (press control+Shift+i) and put cursor at first text box and try to locate value attribute for our first text box.

[pic]

Click on expression Builder and expand ADF Managed Beans and expand mbean and select a variable to bind first text box and click on OK button

[pic]

25) We need do same thing for remaining two variables(b,c)

[pic]

26) Then select command button and again open property inspector.(Control+Shift+i)

Go to Action attribute and click on “V” right side of property inspector and select “Edit” and click on it

[pic]

27) Please select mbean as Managed Bean name and click on new button to create new method in our Addition class.and then give Method Name as add.

[pic]

28) And press ok button in the CreateMethod dialog box.

[pic]

29) And press ok button in the Edit Property: Action dialog.

30) Then all the code will be looks like as given below.

[pic]

And again press Control + S to save all our activities.

31) Open Addtion.java file and add below snippet of code to add method .

public int add() {

c=a+b;

return c;

}

[pic]

32) and save all our activities and then run our AdditionNumbers.jspx file

Right click on AddtionNumbers.jspx file then click Run option then Weblogic server will be starting then our page will be opened in browser

33) And give any two numbers in two text boxes and click submit button then result will be displayed in the third textbox

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download

To fulfill the demand for quickly locating and searching documents.

It is intelligent file search solution for home and business.

Literature Lottery

Related searches