Setting the bean property before opening the Primary dialog

I would like to achieve this functionality.

    <p:commandLink value="prihlasit" oncomplete=";" 
                   action="#{signForProjectBean.setProjectForDetail(item)}" />


I think it's pretty clear what I'm trying to do, I would like to display the row detail in the dataTable that the user has clicked on. So my approach is to set the property of the current row to a bean and then display the part in a dialog. But it doesn't work and I feel like I'm doing something really wrong :-)


source to share

1 answer

If the dialog component needs to display the selected item, you need to ajax-udpate the contents of the dialog before opening it. Otherwise, it will still render the old content as it did when the page was first rendered.

<p:commandLink value="prihlasit" update=":dlg" oncomplete=";" 
               action="#{signForProjectBean.setProjectForDetail(item)}" />


<p:dialog id="dlg" ...>




All Articles