h:selectManyListbox & t:selectItems value属性差异
我正在查看一些现有的代码,并且很好奇 'h:selectManyListbox' 和 'h:selectManyListbox' 之间的区别是什么? 't:selectItems' 值属性是?
<h:selectManyListbox value="#{MyBean.deSelectedFields}" size="10">
<t:selectItems id="selectItemsId" value="#{MyBean.allSelectedFields}" var="item" itemValue="#{item.value}" itemLabel="#{item.label}" />
</h:selectManyListbox>
两个组件的文档说明了相同的事情:
“value 属性设置该组件的当前值。”
http://www.jsftoolbox.com/documentation/tomahawk/09 -TagReference/tomahawk-selectManyListbox.html
http:/ /www.jsftoolbox.com/documentation/help/12-TagReference/core/f_selectItems.html
谢谢
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" value="#{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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
h:selectManyListbox 值
应绑定到选定 选择项的列表/数组。他们将在生成的 HTML元素上设置
selected
属性,其值与列表/数组匹配。t/f:selectItems 值
应绑定到可用 选择项的列表/数组。它们将代表所有 HTML元素。
因此,它们仅代表组件本身的价值。
t/f:selectItems
的值并不立即是h:selectManyListbox
的值。The
h:selectManyListbox value
should be bound to a list/array of selected select items. They will set theselected
attribute on the generated HTML<option>
elements whose value matches the list/array. Thet/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 ofh:selectManyListbox
.