Primefaces DataGrid - CommandLink is not working

前端 未结 1 1989
庸人自扰
庸人自扰 2020-12-21 16:04

i have an issue with nested UI components which is probably a known bug in PrimeFaces and Mojara. However I have no idea how can i solve it.

We have a image gallery

相关标签:
1条回答
  • 2020-12-21 16:08

    @Maple_shaft you are so right!

    correct code:

    <p:dataGrid var="item" value="#{pictureManagementBean.pictures}" id="gallery">  
                    <p:column>
                        <p:panel header="#{item.pictureName}" style="text-align:center"> 
                        <h:panelGrid columns="1" style="width:100%"> 
    
                            <p:graphicImage value="#{item.thumbnailDir}" />                             
                            <h:outputText value="#{item.createdate.toString()}" />                           
                            <p:commandLink value="Delete" 
                                           action="#{pictureManagementBean.removePicture(item.idpicture)}" ajax="false"/>
    
                        </h:panelGrid>
                        </p:panel>
                    </p:column>
                </p:dataGrid>  
    

    So just simple column element. I've just places it wrong before. Thanks so much.

    Of course backing bean is @ViewScoped!

    0 讨论(0)
提交回复
热议问题