h:selectManyListbox & t:selectItems value attribute difference
I'm looking over some existing code and curious as to what the differnce between the 'h:selectManyListbox' & 't:selectItems' value attribute is?
<h:selectManyListbox value="#{MyBean.deSelectedFields}" size="10">
<t:selectItems id="selectItemsId" v开发者_如何学运维alue="#{MyBean.allSelectedFields}" var="item" itemValue="#{item.value}" itemLabel="#{item.label}" />
</h:selectManyListbox>
The documentation for both components states the same thing:
"The value attribute sets the current value for this component."http://www.jsftoolbox.com/documentation/tomahawk/09-TagReference/tomahawk-selectManyListbox.html
http://www.jsftoolbox.com/documentation/help/12-TagReference/core/f_selectItems.html
Thanks
The h:selectManyListbox value
should be bound to a list/array of selected select items. They will set the selected
attribute on the generated HTML <option>
elements whose value matches the list/array. The t/f:selectItems value
should be bound to a list/array of available select items. They will represent all HTML <option>
elements.
So, they just represents the value of the component itself. It is not true that the value of t/f:selectItems
is also immediately the value of h:selectManyListbox
.
精彩评论