Ok, PLEASE lend me your help! I have searched everywere but with no luck. I am trying to display a dialog when i click a commandButton and the backing bean method is finished. But what seems to happen is that the whole page is getting refreshed. I can see that the dialog is flashing by, with the correct values, but then the pages is being refreshed. Here is my code:
xhtml:
<h:commandButton value="Dagens närvaro"
action="#{indexAdmin.initTodaysLecturesAndVisits(date)}"
oncomplete="PF('dlg').show();">
</h:commandButton>
#{indexAdmin.getWeekday(date)}
</div>
</ui:repeat>
<p:dialog id="dialog" header="Dagens Närvavorlistor" widgetVar="dlg" dynamic="true" appendToBody="true">
<h:dataTable value="#{indexAdmin.todaysLectures}" var="lectures"
styleClass="table" headerClass="table-header"
rowClasses="table-odd-row,table-even-row"
columnClasses="none,table-center-col">
<h:column>
<f:facet name="header">Lektion</f:facet>
#{lectures.schoolclass.classname}
</h:column>
<h:column>
<f:facet name="header">Ta Bort(Permanent)</f:facet>
<h:commandLink>
<h:graphicImage alt="Delete" url="/icons/cross.png" />
<!-- <f:ajax render=":inactive_form:" />-->
</h:commandLink>
</h:column>
</h:dataTable>
<div class="clear" />
<h:commandButton value="Hämta PDF"></h:commandButton>
</p:dialog>
I did just pase the code that is relevent, everything is inside a form. Any help is appreciated.