cancel
Showing results for 
Search instead for 
Did you mean: 

Personas - Can status bar text be set using onEnter screen event?

former_member238607
Participant
0 Kudos

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!

Accepted Solutions (1)

Accepted Solutions (1)

Thomas_Mangler
Active Participant

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

Answers (2)

Answers (2)

former_member238607
Participant
0 Kudos

Thanks for the information; this makes perfect sense as to why my code was not working.

Jeff

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.