Unable to trigger the "onHide"/"onShow" events of the Xpages extension library dialog

650 Views Asked by At

I find this strange but I am unable to get any output from the "DOJO" events "onHide()" and "onShow()" for the extension library dialog box. I simply want to access a viewScope variable and set some values to it in the "onHide()" event of the dialog box, but that doesn't seem to work. Even a simple print() statement is not getting executed in the "onHide()" or "onShow()" events. Are there any settings that need to be changed or additional setting that need to be added for these events to work? Am I missing something? Here is the code:

<xp:eventHandler event="onHide" submit="true" refreshMode="complete">
    <xe:this.action><![CDATA[#{javascript:
        //Pass the ratings to the parent window
        var glVect = viewScope.get("Goal_Rate_data");
        print(glVect[0][0] + "@@@" + glVect[0][1] + "@@@" + glVect[0][2]);          
        glVect.get(0).setElementAt("testing assignment",1);
    }]]></xe:this.action>
</xp:eventHandler>`
1

There are 1 best solutions below

0
On BEST ANSWER

You're right that they are Dojo events, so only CSJS. From my chapter of the XPages Extension Library book - "The onShow and onHide events trigger Client-Side JavaScript before the dialog is shown or before the dialog is closed." I'm afraid Server-side Javascript code won't work there.

You can fire partial refreshes on hiding. That's some advanced functionality that the XPages team provided for us, providing a second parameter for the CSJS hide method and the only parameter of the SSJS hide method. All that basically does is call the Dojo client-side Javascript hide method and trigger XSP.partialRefreshGet() on the area you want to refresh.