WebApp replacement for Cursor_Wait / Cursor_Ready
During a timeout for a process completing, what is the recommend visual tool to signal "please wait..."? We have found of course that these do not work:
Send Cursor_Wait of Cursor_Control
Send Cursor_Ready of Cursor_Control
As a workaround, as the process starts, I tried this in the cWebButton's OnClick...
WebSet psCaption of oMyButton to "please wait..."
.... (do the process) ....
WebSet psCaption of oMyButton to "<original button label>"
But those WebSets do not change anything visible in the button.
Other dynamic changes by the process to some nearby objects are displayed.
Why cannot a button's psCaption be changed dynamically?
Perhaps leave the button psCaption alone and use a cWebLabel for the "please wait..."?
Nick
Re: WebApp replacement for Cursor_Wait / Cursor_Ready
Hi Nick,
take a look at [URL="https://docs.dataaccess.com/dataflexhelp/mergedProjects/VDFClassRef/cWebObject-Procedure-SetActionMode.htm"]SetActionMode[/URL].
Re: WebApp replacement for Cursor_Wait / Cursor_Ready
Thanks! Looks like a SetActionMode and setting two other properties have the same results.
Set psWaitMessage to "please wait..."
Set pbShowWaitDialog to True
//
// .or.
//
//Procedure OnLoad
// Forward Send OnLoad
// Send SetActionMode (RefProc(OnClick)) scModeProgress "please wait..."
//End_Procedure
Actually, the soap call in question is so fast, it's a bit jarring to replace the entire app view with that message. Any argument that would pop up a small message box over the existing webapp panel? Had to ask.
Re: WebApp replacement for Cursor_Wait / Cursor_Ready
What worked better is to define a CursorShape object at the top of oWebApp, e.g. "Object MWCursor is a CursorShape"
and then use
Set Cursor of MWCursor to IDC_WAIT
--process timeout--
Set Cursor of MWCursor to 0
Far less jarring than replacing the web page, especially for brief timeouts.
Re: WebApp replacement for Cursor_Wait / Cursor_Ready
I believe this won’t work for a remote session.
Re: WebApp replacement for Cursor_Wait / Cursor_Ready
It's true that all of my development testing uses Localhost.
Perhaps we should set up WAS on our cloud server and test it again?
Nick
Re: WebApp replacement for Cursor_Wait / Cursor_Ready
I am pretty confident that it won’t work.
The cursor class manages the cursor for the environment (windows desktop) where the webapp.exe is running , which is your web server. This class wil never change the cursor for a remote user using a browser visiting your web page.
You will need a javascript running on client browser to handle that.
That is basically what that SetActionMode does.
Re: WebApp replacement for Cursor_Wait / Cursor_Ready
I see what you mean. Took out the CursorShape calls and used this instead. (Which of course Dennis suggested originally!) It worked.
The Wait cursor lasts while OnClick is processing, reverting to Ready cursor when it's done. Because some of our OnClicks contain multiple soap/rest calls one could put each of them in a separate procedure managed by a SetActionMode, instead of using a single (RefProc(OnClick)).
[CODE]
Procedure OnLoad
Forward Send OnLoad
Send SetActionMode (RefProc(OnClick)) scModeWait
End_Procedure
Procedure OnClick
Boolean bOK
Integer iUseAltAcct iAcct iPlg# iPos
Number nAmount
String sGUID sMID sMKEY
Handle hoXML hoRoot hoNode
...
EndProcedure
[/CODE]