P:CommandLink doesn't work with ui:repeat

风格不统一 提交于 2019-12-24 08:57:35

问题


I have strange problem with p:commandLink tag when i use it with the ui:repeat tag !

commandLink doesn't work at all .

this my xhtml code :

<h:form>
    <ui:repeat varStatus="miteraionno" value="#{bussinessOwnerViewerMB.bOwner.bOBranches}" var="branch" >

        <div class="details" >       

        <ul class="services">
            <li>
               <p:commandLink actionListener="#{bussinessOwnerViewerMB.testMethod}" styleClass="nav_services" oncomplete="">
                    <h:outputText value="#{branch.branchName}"/>
               </p:commandLink>
            </li>
        </ul>
        </div>
    </ui:repeat>

the ActionListener is just test method :

public void testMethod(){
    System.out.println("BussinessOwnerViewerMB.changeMapListener()");
}

i try c:foreach but it gives me the same result !

any help will be appreciated ..


回答1:


Change method signature into

public void testMethod(ActionEvent event){
    System.out.println("BussinessOwnerViewerMB.changeMapListener()");
} 

Or change actionListener=... into action="...

also take a look at following answer by BalusC

Differences between action and actionListener


EDIT

Change the scope of your bean into View Scope (cause now its Request Scope)

And read bullet N#4 at the h:commandLink / h:commandButton is not being invoked by BalusC



来源:https://stackoverflow.com/questions/11519884/pcommandlink-doesnt-work-with-uirepeat

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!