commandbutton in dataList inside tab of accordionP

2019-06-06 21:55发布

I cant make work the commandbutton, all data is displayed corectly and the dialogbox is showing but the selectedcontacto is not changing.

    <p:tab title="#{grup.nombre}">
        <p:dataList value="#{grup.listausuarios}" var="cont"
                    paginator="true" rows="5"
                    paginatorTemplate="{PreviousPageLink} {CurrentPageReport} {NextPageLink} {RowsPerPageDropdown}"
                    rowsPerPageTemplate="5,10,15" type="none">      
            <p:commandButton icon="ui-icon-search" update=":frmindex:carDetail" onsuccess="carDialog.show()" title="View Detail">  
                <f:setPropertyActionListener value="#{cont.idusuario}" target="#{bnContactos.selectedcontacto}" />  
            </p:commandButton>

            <h:panelGrid columns="2">
                <p:graphicImage value="/resources/user.png"  width="60" height="100"/>
                <h:panelGrid columns="2">
                    <h:outputText value="Nombre: " />
                    <h:outputText value="#{cont.nombre}" style="font-weight: bold"/>
                    <h:outputText value="Correo: " />
                    <h:outputText value="#{cont.correo}" style="font-weight: bold"/>
                </h:panelGrid>
            </h:panelGrid>
        </p:dataList>       
    </p:tab>
</p:accordionPanel>

EDIT:Finally i found how make it work if someone cares here my new code.(p:column plus process="@this" made the button works why? i dont know i just take something here something of there and result is as following)

<p:accordionPanel id="tcon" value="#{bnContactos.listagruposmodel}" dynamic="true"  var="grup" >
    <p:tab title="#{grup.nombre}">
        <p:dataList value="#{grup.listausuarios}" var="cont" id="dtus"
                    paginator="true" rows="5"
                    paginatorTemplate="{PreviousPageLink} {CurrentPageReport} {NextPageLink} {RowsPerPageDropdown}"
                    rowsPerPageTemplate="5,10,15" lazy="true" >                 
            <p:column>
                <h:panelGrid columns="2">
                    <p:graphicImage value="/resources/user.png"  width="60" height="100"/>
                    <h:panelGrid columns="2">
                        <h:outputText value="Nombre: " />
                        <h:outputText value="#{cont.nombre}" style="font-weight: bold"/>
                        <h:outputText value="Correo: " />
                        <h:outputText value="#{cont.correo}" style="font-weight: bold"/>
                        <p:commandButton process="@this" ajax="true" icon="ui-icon-search" update=":frmindex:messages" action="#{bnContactos.borrar(cont.idusuario)}" title="View Detail"/> 
                    </h:panelGrid>
                </h:panelGrid>
            </p:column>

        </p:dataList>
    </p:tab>
</p:accordionPanel>

0条回答
登录 后发表回答