Editing a property template for JSF library components

Show Me

Property templates determine how a component will access and display data on a page. These templates establish the options that display in the data wizards that you use when you drag data from the Page Data View onto a Web page. Use the templates to remove or add options to the wizard lists or change the tags that are generated when the components are added to the page.

  1. Create a JSF enabled dynamic Web project.

  2. Create a JSF page.

To edit a property template:

  1. Click

    Window | Preferences | Web | JavaServer Faces Tools | Generation Templates. Select one of the three types of templates:

    • Data Templates

    • Iterative Templates

    • Method Templates
    The template preferences window opens and displays all of the currently defined templates.

  2. Select the property template that you want to edit and click

    Edit. The Edit Template dialog opens. The current configuration for the template displays.

  3. Edit the template. You can edit the following information:

    Name

    The name that will display in the data wizards.

    Use for input

    Establishes if the template is used for input or output.

    Class

    The Java™ class for the template.

    Default template for this class

    If this option is selected, this template is listed as the first item in the data type menu of the data wizard. All other templates are listed in alphabetical order.

    Description

    A brief description of the template.

    Pattern

    A preview of how the component will display when it is added to a Web page. The pattern will include variables that are dynamically computed based on the Web page where the template is used and the data to which the component is bound. To see a list of available variables, click

    Insert Variable. The available variables include taglib prefixes, for example the core JSF taglib http://java.sun.com/jsf/core, and attributes, for example value. When a variable is inserted into a pattern, it displays as ${variable_name}. For example ${action}.

  4. When you are finished editing the template, click OK. The Edit Template dialog closes.

  5. Click OK. The Properties dialog closes.

Once you have edited a property template for the JSF library components, you can create Web pages that access data by dropping data onto a Web page from the Page Data View. This will launch the data wizard that enables you to select control types for the property templates that you have edited and created. For more information on adding data to a Web page, refer to Adding data to a JSF page using data viewing components.

 

Related concepts

Data table components