Im trying to change the cursor on ALL the page were working on, so far ive only been able to change the cursor on a Canvas (or many Canvas) is there a way to change the cursor on the whole page without having to change it on all canvas ?
document.body.style.cursor = “wait”;
and
<style>{cursor:“wait”}</style>
Well, i found a solution it works but i don’t like it…
var allElems = document.getElementsByTagName(“*”);
for(var x = 0; x < allElems.length; x++)
{
allElems.style.cursor=“wait”;
}
Problem:
I have a few components without any header and in the previous ‘for’ loop i get a this.header has no properties and other stuff like this…noting i can’t fix but this prove my solution is only a patch and not a deployable solution…
AND the major f**k is the function call with “*” as parameters. It can stop working anytime, anywhere and may not work on “obscure” browser…Alternative: document.all but this doesn’t seems better as its only seems to be supporter on IE.
If you are trying to show a wait cursor over the entire screen, just make one transparent or translucent fullscreen Canvas with that cursor and call bringToFront() on it.
However if you are doing this during a modal network operation, this is already one of the available built-in behaviors controlled via RPCManager.promptStyle.
Thanks, the transparent canvas trick works great BUT this is not really what i need. If i use the canvas trick, the cursor show but all the action on the component are taken to the canvas…in other words the user can’t click anywhere when i icon is there trough the transparent canvas ie: modal page.
My application has like 2 state (flip-flop):
Both states need their own cursor over the entire screen (± 50 visible smartclient component)
To get this working i would have to apply the cursor style on each smartclient component right ?
There is an internal, undocumented method canvas.getCurrentCursor() which you could replace system-wide with your own method via isc.Canvas.addProperties(). Your new method could return a different cursor when in your special, then call the original method, which you would retain under a different name. This is a hack but better than what you’ve been contemplating, I think.
By the way, can you explain what this special mode is for? We’d like to understand if it’s a common use case that SmartClient should have better support for.