Skip to main content
avillanueva
23-Emerald I
23-Emerald I
March 3, 2023
Solved

Pushing events to the confirmation message (yellow drop down banner at top)

  • March 3, 2023
  • 2 replies
  • 1914 views

I believe someone suggested look at this in the past to remind users of tasks or things. I am not looking for the banner message which I used for system announcements. I am looking to have the yellow banner message ping users perhaps when they log in. I am not sure that's a triggerable event.

avillanueva_1-1677874216253.png

Is this documented in Customizer's guide and if so, under what search terms? Is there a better mechanism? I can see this working to appear when the user logs in or at a certain time of the day. I am holding just sending an email in my back pocket.

Example: 

"You have X tasks in your queue that need attention and XX tasks are past due"

 

Best answer by avillanueva

I actually found code that displays a message as a result of an action not necessarily login but should be the path to follow.

as part or a Processor doOperation(..), it returns a FormResult. There is a feedback message that goes into the yellow banner.

fbMsg = new FeedbackMessage(FeedbackType.FAILURE, (Locale)null, null, (ArrayList<String>)null, (wt.util.LocalizableMessage[]) null);
fbMsg.addMessage("Your message here ");
formresult.addFeedbackMessage(fbMsg);
return formresult;

 

2 replies

17-Peridot
March 6, 2023

The documentation is in the JSDoc. I think the biggest challenge is finding and throwing the right event. 

 

Screenshot 2023-03-06 at 07.49.35.png

avillanueva
23-Emerald I
23-Emerald I
March 6, 2023

Thanks found the JSDoc page. Considering this is handled via Javascript, I do not think a server side event can trigger this. It makes sense since this typically appears at the end of some action the user has done. It could be hooked into the home tab but ideally, the goal is to directly them back to this page. It has to balance that line of not being too annoying for users but a gentle reminder so not every time they refresh a certain page. Thanks, this gives me the place to look at a sense or effort. So long as no one else comes along with a canned solution, you'll get credit.

avillanueva
23-Emerald I
avillanueva23-Emerald IAuthorAnswer
23-Emerald I
April 13, 2023

I actually found code that displays a message as a result of an action not necessarily login but should be the path to follow.

as part or a Processor doOperation(..), it returns a FormResult. There is a feedback message that goes into the yellow banner.

fbMsg = new FeedbackMessage(FeedbackType.FAILURE, (Locale)null, null, (ArrayList<String>)null, (wt.util.LocalizableMessage[]) null);
fbMsg.addMessage("Your message here ");
formresult.addFeedbackMessage(fbMsg);
return formresult;

 

jbailey
18-Opal
April 20, 2023

You might find this interesting...

https://www.w3schools.com/howto/howto_js_alert.asp

 

We have moved to this for alert banners and a login "do you accept these terms" page that appears only once per session (the default code in the banner.txt will appear at every refresh/login etc)

 

We had to add a custom .jsp file to load in addition to begin_custom.jspf.