Você está na página 1de 4

Hello World

In this example, we will create a jspx page and add a text box, command button and a
label. When user enters his name in the text box and clicks on the command button, label
will show the Hello <user> as output.

I am assuming that we have already created a project.

1) Create a jspx page.

Make sure that you generate the backing bean for the page.
You will notice that a backing bean is generated along with the jspx page under
the Application Sources folder under your project.
Backing bean are JavaBeans used mainly to provide UI logic for handling
events and page flow.

2) Add a PanelPage to the created jspx page.


3) Insert a panelForm inside the panelPage.
4) After adding panelPage, add a labeled text box inside the panelForm and
command button to the footer of the PanelFrom .
5) Also add the output label widget from ADF Face code from component palette to
the panelForm.

6) Double click on the command button to bind the Command Button to the backing
bean generated.
You will notice that method with name commandButton1_action() is generated
inside the backing bean class.

7) Add the following code inside the commandButton1_action() method :-

public String commandButton1_action() {


CoreInputText a=getInputText1();
String s1=a.getValue().toString();
String s= " Hello " + s1;
outputLabel1.setValue(s);
return null;
}
Here InputText1 refers to the instance of the input text box object created
above. And outputLabel1 refers to the instance of the output label created
above.
8) Run your jspx page.

Você também pode gostar