C H A P T E R  32

Resource Bundle Model

The Resource Bundle Model enables a developer to use a resource bundle to retrieve localized values. Model field names used in this model are the names of these resources. A common use of the resource bundle model is to localize a page by forming any localized content with static text display fields and binding the display fields to a resource bundle model. The locale used by the model to find resources at runtime may be set programmatically. If not set, the model will use the default system locale.

This model component has a model field chooser which will display the available resources if the resource bundle has been set. In addition, this model supports predefined model fields which encapsulate a resource name. In this way, if resource names change in the bundle, clients of the model will be insulated from the resource name change. Another possible use of the model fields would be to dynamically change a field's resource name at runtime without affecting clients bound to the model field.

Property Name

Description

Notes

Bundle Name

The fully qualified resource name of the bundle (for example, "com/sun/jato/Bundle").

Req

Name

The class name of the component.

Req


Fields

Property Name

Description

Notes

Name

The logical name of the model field.

Req

Resource Name

The key in the resource bundle associated with this model. This property value may be null (not set) if the developer wishes to rely on the model field name property to also represent the name of the resource name. If this property value is set, it must match the name of the resource found in the bundle.