Table of Contents Previous Section

WOToManyRelationship

Synopsis

WOToManyRelationship { sourceEntityName = anEntity; relationshipKey = aKey; sourceObject = anObject; [isMandatory = YES|NO;] [destinationDisplayKey = aKey;] [dataSource = aDataSource;] [uiStyle = "browser" | "checkbox" ;] };

Description

The WOToManyRelationship component displays items from a to-many relationship in either a browser or a check-box list. Users can select one or more items from this list to learn more about those items.

For example, suppose you have a database of Movies where each movie is a table (or entity). Each movie has one or more roles, which means that the Movies table would have a to-many relationship with the MovieRoles table. You could use this component on a page that displays information about a movie, using this component to display the roles associated with this movie.

This component is used only in applications that access a database using the Enterprise Objects Framework. In particular, it is used if you use Direct to Web to create your application. Because WOToManyRelationship returns a form element, it must be used within an HTML form.

sourceEntityName
The name of the entity that contains the relationship. In the Movies example, this would be "Movies."
relationshipKey
The key for the relationship that you want to display. In the Movies example, you'd want to display the roles key.
sourceObject
An object that contains the actual relationship value. This object can be an enterprise object, a mutable dictionary, or anything else that can contain the relationship. Upon return, this object contains the user's selection.
isMandatory
If YES, the relationship must exist. If the relationship must exist, the element must have at least one item selected when the form is submitted, so the WOToManyRelationship selects the first item if the list if the user has not selected any. If NO, the relationship is optional.
destinationDisplayKey
Property to display in the list. For example, with the MovieRoles entity, you would want to display the roleName property.
dataSource
EODatabaseDatasource containing the items in the to-many relationship.
uiStyle
If "browser", displays as a browser. If "checkbox", displays as a list of check boxes. The default depends on the number of items in the list. If there are less than 5 items, the default is a check-box list. If there are 5 items or more, the default is a browser.

Table of Contents Next Section