- WOToOneRelationship { sourceEntityName = anEntity; relationshipKey = aKey; sourceObject = anObject; [dataSource = aDataSource;] [destinationDisplayKey = aKey;] [isMandatory = YES|NO;] [uiStyle = "radio"|"popup"|"browser";] };
Description
The WOToOneRelationship component displays items from a to-one relationship in a pop-up list, a radio button list, or a browser. Users can select an item from this list to learn more about that item.For example, suppose you have a database of Movies where each movie is a table (or entity). Each movie has only one studio, which means that the Movies table would have a to-one relationship with the Studios table. You could use this component on a page that displays information about a movie, using this component to display the studio associated with the 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 WOToOneRelationship 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 studios 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.
- dataSource
- EODatabaseDataSource containing the items in the to-one relationship.
- destinationDisplayKey
- Property to display in the list. For example, with the Studio entity, you would want to display the name property.
- isMandatory
- If YES, the relationship must exist. If NO, the relationship is optional.
- uiStyle
- Specifies how to display the list: as a browser, a radio button list, or a pop-up list. The default depends on the number of items in the list. If there are less than 5 items, the default is a radio button list. If between 5 and 20 items, the default is a pop-up list. If there are more than 20 items, a browser is used.