문제

               <h:form id="myform">
                    <h:panelGrid columns="1" cellpadding="10">
                        <p:selectOneMenu id="suburbs" value="#{cityBean.cityName}" style="width: 200px" >  
                            <f:selectItems value="#{cityBean.cityNames}" style="width: 200px"/> 
                            <p:ajax update="@form"  
                                    listener="#{cityBean.handleCityChange}" />
                        </p:selectOneMenu>

                        <p:dataTable   style="padding: 20px"  value="#{cityBean.getSchoolList()}" var="school" id="schools"  >  
                            <f:facet name="header">  
                                Okullar 
                            </f:facet> 
                            <p:column>
                                <p:commandLink async="false" process="@all"  value="#{school.schoolName}"  update=":tabv"  title="View Detail" action="#{cityBean.schoolAction(school.schoolId)}"/> 
                            </p:column>
                            <br></br>
                            <br></br>
                        </p:dataTable> 

                    </h:panelGrid>
                </h:form>

When firstly page is opened, there is 3 school in the datalist and all these three links ara working. When I select another city which has 5 schools, only three links are working, two are not working. Is there any solution to this problem?

도움이 되었습니까?

해결책

You are missing the rowKey attribute from the <p:dataTable> component so I am assuming that you are using an earlier version of PrimeFaces like version 2.2.

There were known bugs with older versions of primefaces where ajax events invoked from within a dataTable would not properly update contents of the page.

http://blog.primefaces.org/?p=2119

However more fundamentally the problem could just be simpler than that:

<p:commandLink ... update=":tabv" ... />

You have this commandLink component updating an id that you never provided code for. It would be impossible to say if there isn't something else wrong here. In the meantime I suggest that you try to use Javascript to invoke a click event in a commandLink or commandButton outside of the dataTable to see if that solves your problems. If not then you should consider upgrading to a newer version of PrimeFaces.

다른 팁

I encountered same problem using dataList. This helped:

<p:dataList type="definition"...
    <f:facet name="description">
    ...
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top