1
votes

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.

3

3 Answers

6
votes

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

0
votes

If I understand you correctly you want to send an attachment to the user but remain on the same page. and after the attachment is delivered close the dialogbox.

the problem above is that your code tries to do two things at once. both clse the dialog and deliver the attachment. That isn't possible.

I see two solutions I would try.

  1. Remove the getcomponent('exampleDialog').hide() and execute that thru a button onclick on a second hidden button in the oncomplete event.

  2. If that don't work, set the url to the export_hidden.xsp in an hidden iframe in your dialogbox and also do a on button click on a hidden button the closes the dialogbox

0
votes

Doing the CSJS with partial update on the dialog box, along with context.redirectToPage(xAgentName) will work, Domino 9.0.1 FP9.