2017-05-03 17 views
0

我在我的jsf頁面中使用了一個ui:repeat,我想在列表的每個元素上使用tabindex。 我試着用下面的代碼。 請幫我解決這個問題。如何在ui中使用tab索引:在primefaces中重複使用?

<div class="meta-list"> 
    <p:outputPanel> 
     <ui:repeat var="com2" value="#{masterDataBean.mylist}" varStatus="loop" tabindex="1">   
     <p:commandLink value="#{com.value} " action="#{masterDataBean.doSomething}" tabindex="2"> 
      <f:setPropertyActionListener target="#{masterDataBean.selecteData}" value="#{com2}" /> 
     </p:commandLink> 
     </ui:repeat> 
    </p:outputPanel> 
</div> 
+1

有像''上的UI tabindex'無屬性:repeat'標籤?你究竟想要做什麼? –

+1

對於索引,你可以從'varStatus'值開始'#{loop.index}'。 –

+0

我想使用列表中的選項卡按鈕迭代所有元素。 @Prakash – Mihir

回答

2

您可以設置p:commandLinktabindexui:repeat標籤使用的varStatus="loop"#{loop.index}動態迭代索引值,如下:

<div class="meta-list"> 
    <p:outputPanel> 
     <ui:repeat var="com2" value="#{masterDataBean.mylist}" varStatus="loop"> 
     <p:commandLink value="#{com.value}" 
      action="#{masterDataBean.doSomething}" tabindex="#{loop.index}"> 
      <f:setPropertyActionListener value="#{com2}" 
       target="#{masterDataBean.selecteData}" /> 
     </p:commandLink> 
     </ui:repeat> 
    </p:outputPanel> 
</div> 
+0

@Mhhir:如果我理解你的問題,那就應該這樣做! –

相關問題