Java Reference
In-Depth Information
forwards as in JSPs thereby separating the controller function from the view. But where is the controller function
moved to? The controller function is defined in a project file called faces-config using XML (e X tensible M arkup
L anguage. We will show the XML that defines a navigation rule but more importantly, we will show how to have RAD
generate the XML for us.
To satisfy number 2 (from above), we will first use a type of scripting variable called a session scope variable .
A session scope variable is accessible by any Java object within the EAR. This variable will hold the employee number.
We will use binding to ensure that GetEmp sets the variable's value to the employee number and that UpdateEmp
retrieves the employee number from the variable.
Scripting variables are a very powerful tool; however, scripting variables and SDO (RRLs and RRs) do not work as
smoothly together as JSF and SDO do.
Tutorial: Defining a Scripting Variable
We will go through the procedure for creating and using the scripting variable (because they are so useful) and then
show how SDOs, links, and parameters can be used to perform the same function.
1.
Close any open editing or browser sessions.
2.
In TutorialsJSF/WebContent/c12, create a new Facelet called GetEmp.
3.
Insert an HTML table with one column, three rows, and a border width of zero, and center
the table on the page.
4.
In the first cell, enter the following text: Enter the employee number to update and click
the Submit button.
5.
From the Standard Faces Component drawer in the Palette, click on the Input component
and then click on the second cell in the table.
6.
From the Standard Faces Component drawer in the Palette, click on the Button -
Command component and then click on the third cell in the table.
7.
On the left side of the Properties view, click the td tab (see Figure 12-32 ).
 
Search WWH ::




Custom Search