我有2个列表,一个包含h的元素:selectOneMenu(包含整数itemValue和string itemLabel)和一个用于h:dataTable(具有Id with应该在selectOneMenu中显示,如默认值)。 如何通过id从其他列表中设置selectOneMenu的默认值。 需要得到类似的东西:
curl.exe -o NUL -w "Time: %TIME% Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total}\n" http://www.google.com
真正的代码是:
for(role.roleId == o.userRoleId){ //do something}
和豆类
<h:dataTable value="#{accountsManagmentBean.users}" var="o"
border="0"
styleClass="users-table"
headerClass="users-table-header"
rowClasses="users-table-odd-row,users-table-even-row">
<h:column>
<f:facet name="header">role</f:facet>
<h:selectOneMenu value="#{accountsManagmentBean.roles}">
<f:selectItems value="#{accountsManagmentBean.roles}" var="role" itemValue="#{role.roleId}" itemLabel="#{role.roleName}" />
#{o.userRoleId} //default value Id
</h:selectOneMenu>
</h:column>