Name

SelectMany/Listbox

Synopsis

This renderer represents a select-many component as a selection list.

Component family:

javax.faces.SelectMany

Renderer type:

javax.faces.Listbox

Renders children:

No

Encode behavior

Renders the component as an HTML <select> element with a name attribute set to the component’s client ID and a multiple attribute. If the size attribute is set, it is added to the <select> element with the specified value; otherwise a size attribute with the number of choices as the value is added. Each choice represented by the component’s children (one or more UISelectItem and UISelectItems components) is rendered as an <option> element or as an <optgroup> element if the child is of the UISelectItemGroup subtype. For all choices that match one of the component’s values, the selected attribute is set for the corresponding <option> element. If a choice is marked as disabled, the disabled attribute is also added.

Decode behavior

Looks for request parameters with the component’s client ID as the name. If it finds parameters, the renderer the calls component’s setSubmittedValue() method with a String[] holding all parameter values as the value; otherwise it calls the same method with an empty String[] as the value.

Attributes

[accesskey="accessKey"] [dir="ltr|rtl"] [disabled="true|false"]
[lang="lang"] [onblur="code"] [onchange="code"] [onclick="code"]
[ondblclick="code"] [onfocus="code"] [onkeydown="code"]
[onkeypress="code"] [onkeyup="code"] [onmousedown="code"] [onmousemove=" ...

Get JavaServer Faces now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.