How do I use property classes?

Many of the attributes for the UI components and properties for the managed beans need to be set to instances of property classes. To illustrate how to use these property classes in an application, consider the following example.

Example

The Logon component has an attribute called logonButton. That attribute must be set to an instance of the SubmitButton class, which contains the properties that define the look and behavior of the button for the logon form. To access and manipulate these properties, the Logon component must reference a bean that instantiates the SubmitButton class. First you must configure a managed bean entry in your faces-config.xml file:

<managed-bean>

    <managed-bean-name>customLogonButton</managed-bean-name>

    <managed-bean-class>com.businessobjects.jsf.sdk.properties.SubmitButtonProps</managed-bean-class>

    <managed-bean-scope>session</managed-bean-scope>

    <managed-property>

        <property-name>text</property-name>

        <value>Submit logon</value>

    </managed-property>

</managed-bean>

In the example, you have created a custom logon button for your logon form, called "customLogonButton", that displays "Submit logon" as the text on the button.

Next, add a reference to this bean from the Logon component tag.

logonButton="#{customLogonButton}"

The formatting and behavior of the Logon component's logon button will now be governed by the data in the newly created bean. The bean can be further configured and its property values changed within the faces-config.xml file. All component attributes that require property classes function this way.

In addition, the EnterpriseItems and Identity beans contain properties that must be configured for property classes. A reference to a property bean can be added similar to the way components are added, by initializing the EnterpriseItem or Identity bean's property in the faces-config.xml file. For details, see How do I configure the default values of Java beans?.

A list of the component attributes and managed bean properties that require property classes is shown in the following tables.

Note:    For detailed documentation on the property classes, see the com.businessobjects.jsf.sdk.properties package in the JavaServer Faces Components for BusinessObjects Enterprise Java API Reference.

UI ComponentAttributeProperty Class

Logon

authentication

AuthenticationProps

Logon

logoffButton

SubmitButtonProps

Logon

logonButton

SubmitButtonProps

Logon

system

SystemProps

ItemsGrid

alerts

AlertProps

ItemsGrid

pagerStyle

PagerProps

Path

showImages

ImagesProps

Managed BeanPropertyProperty Class

EnterpriseItems

paging

PagingProps

EnterpriseItems

sortBy

SortProps



Business Objects
http://www.businessobjects.com/
Support services
http://www.businessobjects.com/services/support/