What is the difference between the selectitem and selectitems tags in jsf?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The difference is exactly what you would expect. The
selectitemtag adds a single item to the HTML list whileselectitemsadds multiple items.From JSF Core Tag Reference:
SelectItem:
The
SelectItemtag adds a childUISelectItemcomponent to the component associated with the enclosing tag. In the HTML renderkit, this creates a single element. It can be used with any of the select tags in the JSF HTML tag library. The body content of this tag must be empty.Example:
HTML Output:
SelectItems:
The
SelectItemstag adds a childUISelectItemscomponent to the component associated with enclosing tag. You can use this tag to set a list of objects in your domain model as the options for a select component. The body content of this tag must be empty.Example:
HTML Output: