0

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.

SwissArmyKnife
  • 200
  • 1
  • 12
  • How exactly did you got `oncomplete` to work on a ``? Nonetheless, the `` doesn't send an ajax request by default, so there's a full page reload. See the duplicate for the right approach. – BalusC Feb 29 '16 at 22:04
  • Wow. i feel so stupid. Thanks for setting me straight Balus. And sorry for the Duplicate. It works now. – SwissArmyKnife Mar 01 '16 at 06:38
  • No problem :) Glad the duplicate helps. – BalusC Mar 01 '16 at 06:38

0 Answers0