commandbutton in dataList inside tab of accordionPanel is it posible primefaces jsf

本小妞迷上赌 提交于 2019-12-10 11:34:32

问题


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>

来源:https://stackoverflow.com/questions/11426433/commandbutton-in-datalist-inside-tab-of-accordionpanel-is-it-posible-primefaces

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