Friday, May 29, 2015

Overriding uncommitted data warning message - Part 1


I'm sure you might be knowing about uncommitted data warning message you get, when user tries to navigate out of current page without saving the data. Refer Oracle & Ashish post for more details.




Today, I'm going to show you how you can override standard message displayed in this popup.

Expand your ViewController project & open the trinidad-skin.xml file





I defined a new Java resource bundle for my skin, you can also specify a .properties or xlff file.
Then created a Java file as below:


If you notice, I'm extending from ListResourceBundle & then overridden a key called af_document.MSG_CONFIRM_NAVIGATION

That's it, you can run your application now & see this new message being displayed when you get uncommitted warning message.



Refer Part -2 to find out how to locate the default key that needs to be overridden.

Hope this helps!!!

No comments:

Post a Comment