Implementing AJAX Components in the JWL Framework, Page 4
- Create a new Java class ThreeStringsConcatenatorBean.java with three variables: text1, text2, text3.
- In ThreeStringsConcatenatorBean.java, generate getter and setter methods for the variables. Add a new getConcatenateThreeFields() method that will concatenate text1, text2, and text3 and return the result.
- Select ajaxRefreshSubmitExample.jsp. Under the Page Data view, select Faces Managed Beans → New → Faces Managed Bean.
- Register the ThreeStringsConcatenatorBean JavaBean in faces-config.xml.
- Map fields in the JavaBean with fields in the JSP page by dragging fields from the bean onto the page.

Click here for a larger image.
Figure 11: Create New Java Class—ThreeStringsConcatenatorBean.java
public String getConcatenateThreeFields() { return text1 + text2 + text3; }

Figure 12: Create a New Faces Managed Bean

Click here for a larger image.
Figure 13: Register a New Faces Managed Bean

Click here for a larger image.
Figure 14: Map Bean Fields to Input Field on the Page
0 Comments (click to add your comment)
Networking Solutions
