Building a Web Page Using a Managed Bean

After you create a Web application project, you can add Web pages. Use a managed bean to provide data and actions for the Web page. The data comes from managed bean properties, and the actions come from managed bean methods.

These managed beans define various types of data and actions for the Web page:


  1. Create a managed bean.
  2. Create a Web page.
  3. In the Data Bindings view, Drag and drop the managed bean you want to use onto the Web page. The Create JSF Components wizard opens.
  4. To map the managed bean attributes to JSF components:
    1. Unselect attributes that you do not want to map.
    2. Edit a JSF component by clicking in its cell, clicking the down arrow, and selecting a new JSF component.
    3. Edit the text in the Label column to the appropriate name for each member.
    4. To change an attribute mapping, select the attribute and click Move Up or Move Down.
    5. Click:
      • Next to configure a container to hold the new components.
      • Finish to accept the defaults and skip the rest of this procedure.
  5. On the Configure a Container to Hold the Generated Components page:
    Option Action
    Use a table-type container
    1. Select Use Table-Typed container to Hold Components.
    2. Select either a JSF panelGrid or an HTML Table.
    3. Type the number of component pairs that you want to appear in each row.
    Do not use a container Select Do Not Use Container.
  6. Click Next. The generated code from your selections displays.
  7. Click Finish. The Web page with your selections is generated.
  8. Select File > Save from the main menu bar to save the Web page.
  9. (Optional) Click the Preview tab.
Related tasks
Adding a Data-Driven Component to a Web Application
Adding a Service-Driven Component to a Web Application

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.