The ace:simpleSelectOneMenu component is simple selection component, similar to the standard h:selectOneMenu, that integrates well with the ACE environment by providing ajax support, ARIA support, label positions, and theming. Option items are defined by the <f:selectItem> tag. If the backing list is javax.faces.model.SelectItem objects the <f:selectItems> tag can be used. If the backing list is not made of SelectItem objects (such as a String array), see the Dynamic Items section below for information on how to render those items.
In its simplest form, an ace:simpleSelectOneMenu component only requires to have some options defined and to bind its value to a property in a backing bean.
As mentioned for a dynamic list not composed of SelectItem objects use a TagHandler (like <c:forEach>) to loop through your list and output individual <f:selectItem> tags. For example, where bean.category is a String:Keep in mind you will need the jstl.jar and xmlns:c="http://java.sun.com/jsp/jstl/core" namespace for this approach.
Full ARIA support. Native <select> element preserved.
The following ARIA roles are supported: select, option.
This component supports built-in labels. The text specified in the label attribute will be rendered next to the main input field of this component. The position specified by labelPosition will determine where this label is going to be rendered; the possible values are left, right, top, bottom, none and inField (to render the label in the field itself).
The requiredIndicator attribute specifies the text to be displayed next to the main input field when this component is marked as required. When, this component is not marked as required, then the text specified in the optionalIndicator is going to be rendered. The indicatorPosition attribute determines where this indicator text is going to the rendered; the possible values are left, right, top, bottom, labelLeft, labelRight, and none.
Then this component is marked as required, the main input field receives the CSS class ui-state-required, otherwise, it receives the CSS class ui-state-optional. When this component is marked as invalid by the app, it will be rendered with the CSS class ui-state-error. These CSS classes can be used to add custom styling to this component, in order indicate its current state in a more visual way.
The following markup represents the basic HTML structure of the component and the CSS classes it uses.
© Copyright 2018 ICEsoft Technologies Canada Corp.