on 10-03-2018 4:29 PM
Hi,
We are running Personas 3.0 SP7, and I am developing in Slipstream.
I'm wondering if it is possible to set a message on the status bar from script in the onEnter event. For the flavors I'm creating, I'm displaying error messages in the status bar, using code like this:
session.findById("wnd[0]/sbar").setMessage("My error message", "E");
This works fine for events like onClick, but when I attempt to use it in an onEnter event, the screen just flashes and no message appears in the status bar. I know the onEnter script is running as I can display the message through an alert or dialog box. I see this behavior in Slipstream and in the traditional rendering engine.
I need to keep my error handling standardized, so if I can't get onEnter to set a message in the status bar, I'll need to change all my others to use an alert or dialog. I'd really want to use the status bar as it is more standard and a cleaner design.
Does anyone have any ideas on how to set status bar text from the onEnter event?
Thank you very much for your help!
Hi Jeff,
i think this is a bug.
try it like this
session.findById("wnd[0]/sbar").setMessage("My error message", "E");
return true;
Best regards,
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the information; this makes perfect sense as to why my code was not working.
Jeff
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The solution to the question is indeed what Thomas posted, however this is not a bug.
The reason for needing the return true; is that this way, you are suppressing the standard ENTER reaction, which clears out the message bar most of the time. The onEnter event can be suppressed by your script, whereas others like onLoad cannot, therefore no need for return true. So in this case, you do want to override the standard onEnter action, which would get rid of the message you just set.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
64 | |
8 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.