Search code examples
xpagesxpages-ssjsxpages-extlib

xpages redirect to page and close current dialog


My button code :

    <xp:button value="Raport" id="button1" styleClass="lotusFormButton"
                            style="float:right;">
                            <xp:eventHandler event="onclick"
                                submit="true" refreshMode="complete" immediate="false"
                                save="true" id="eventHandler2">
                                <xp:this.action><![CDATA[#{javascript:context.redirectToPage("export_hidden.xsp");
getcomponent('exampleDialog').hide()}]]></xp:this.action>
                            </xp:eventHandler>
                        </xp:button>

It just go to the export_hidden.xsp ( XAgent for creating an excel file ) but without closing the dialog.

I tried reverse the 2 actions, but same results.

I appreciate your time.


Solution

  • Add a client-side call to XSP.closeDialog('#{id:exampleDialog}') in the onComplete event of the eventHandler.