我想在jquery中创建一个泛型函数来选择所有功能.我的网页上有一个标签视图.
我的组件的ID是:tabId:someDynamicId:rowId:componentId其中,someDynamicId是动态生成的.
所以在jquery中我想找到id以 - tabId:someDynamicId&以componentId结尾的元素.并且,tabId,someDynamicId和componentId将作为参数传递给需要查找此元素的泛型函数.
如何设置ui的id:重复
我的代码的结构是
Tabview
ui : repeat
dattable
column
checkbox
Run Code Online (Sandbox Code Playgroud)
我得到复选框的id为
tabViewId:0:j_idt45:0:dataTableId:0:checkBoxId
Run Code Online (Sandbox Code Playgroud)
它包含7件事
id of tabview
active tab
ui:repeat id
index of ui:repeat
id of dattable
row of dattable
id of checkbox
Run Code Online (Sandbox Code Playgroud)
我想指定ui的id:重复,以便它不会自己选择它.
如何设置ui的id:重复,比方说
repeatId
Run Code Online (Sandbox Code Playgroud)
代替 j_idt45
我有一个键列表'ListA'.密钥和列表的地图说'MapA'.我需要迭代'ListA'并为每个关键需要从'MapA'获取它的值.这些值充当dataTable的模型.
为此,我在ui:repeat中使用h:datatable.
<ui:repeat var="entry" value="#{bean.sampleDTO.sampleList}"
varStatus="row">
<tr>
<td>#{entry.key}</td>
<td><h:datatable value="#{bean.map[#{entry.key}]}" var="row">
<h:column>
// something
</h:column>
</h:datatable></td>
</tr>
</ui:repeat>
Run Code Online (Sandbox Code Playgroud)
请考虑datatable的值:
value="#{bean.map[#{entry.key}]}"
Run Code Online (Sandbox Code Playgroud)
问题是密钥是我从#{entry.key}得到的变量.#{bean.map [#{entry.key}]}是无效的EL表达式,因为不能使用2#.
谢谢,Tarun Madaan
我想在我的数据表中使用条件css.这是我的代码.
<ui:repeat var="myVar" value="#{bean.list}" varStatus="row">
<c:if test="#{row.index % 2 == 0}">
<c:set value="RowColorGrid" var="rowClass"></c:set>
<c:set value="ArticleColor" var="articleClass"></c:set>
</c:if>
<c:if test="#{row.index % 2 != 0}">
<c:set value="RowColorGrid2" var="rowClass"></c:set>
<c:set value="ArticleColor2" var="articleClass"></c:set>
</c:if>
<tr>
<td> Some value </td>
<td class = "#{articleClass}">
<h:dataTable id="myId" value="#{bean.value}" var="myVO" width="100%"
rowClasses="#{rowClass}">
----Some code---
</h:datatable>
</td>
</ui:repeat>
Run Code Online (Sandbox Code Playgroud)
但在JSF中我不想使用JSTL标签.还有其他替代方案吗?使用JSF的一些组件???
我想在td中使用一个类,在数据表的行类中使用一个.
提前致谢.Tarun Madaan