我尝试使用JSF核心c:forEach为treeNode中的每个项启用唯一ID,但最终出现错误。任何帮助和建议都会很棒。这是代码:
<s:div id="sourceTreePanel" style="overflow: auto; height: 398px; padding: 0 0 10px 0;">
<rich:tree id="fullExportSourceSelectionTree" value="#{exportFormFolderTreePageBean.exportSourceFolderTree}" var="node"
ajaxSingle="true" stateAdvisor="#{defaultFolderTreeStateAdvisor}" ignoreDupResponses="true"
nodeSelectListener="#{exportFormFolderTreePageController.nodeSelectMultiple}" switchType="ajax"
ajaxSubmitSelection="true" limitToList="true" reRender="fullExportSourceSelectionTree, includeSubExportSourcefolders, selectedTable, selectedFolderCountPane, clearSelectionButton">
<c:forEach varStatus="loop">
<rich:treeNode id="foldertree_#{loop.index}" icon="#{exportFormFolderTreePageBean.exportSourceFoldersList.contains(node) ? 'img/tree/selected.png' : node.folderTreeItem.icon}"
iconLeaf="#{exportFormFolderTreePageBean.exportSourceFoldersList.contains(node) ? 'img/tree/selected.png' : node.folderTreeItem.icon}" >
<h:outputText value="#{node.folderTreeItem.folderName}" />
</rich:treeNode>
</c:forEach>
</rich:tree>
</s:div>