I use an to show a message while running some code via a JsonRpcService. Works like a charm.
Now, I would like show a similar message saying "Please wait..." when the user submits a page. In this particular case it is logging in - where I need to read a lot of data to show the user. I submit the login info in a custom control when the user presses the icon (=button):
<xp:image url="/arrowGrey.png" id="submitButton" styleClass="submitButton" alt="Login" title="Login">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:Logon.submit()}]]></xp:this.action>
<xp:this.onStart><![CDATA[console.log('Start login');
setTimeout(function () {
XSP.openDialog('#{id:working}');
}, 300);]]></xp:this.onStart>
</xp:eventHandler>
</xp:image>
Logon is a managed bean. However, I never see the dialog box... - nor the "Start login" message?
The definition of the is:
<xe:dialog id="working" styleClass="inProgress">
<xp:div>
<xp:text escape="true" id="computedField1" tagName="h2" value="Logging in. Please wait..."></xp:text>
</xp:div>
</xe:dialog>
Any ideas as to how to obtain this?
The obvious next challenge is to close the dialog should the Logon.submit() fail validation and keep the user on the current page... :-)