Dive into Oracle ADF

Send me a mail
 Dive into Oracle ADF   Click to see the XML version of this web page.   (Updated: 2/3/2008; 9:21:26 PM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper IDE

Search blog with Google:
 

Search BC4J JavaDoc:
 

January 2007
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Dec   Feb

Get Firefox!

Thursday, January 18, 2007

In this thread over in the OTN discussion forum, Jack found a small problem with my Example #95 that illustrates how let the end-user toggle the ADF/JSF UI language on the fly. He reported that he'd tried to localize the message text for an ADF list binding so that null entry in the list would show up like "<Any Selection>" in the dropdown. However, after toggling the language the null entry re-rendered in the previous language until a second, subsequent request.

This was a subtle problem related to the fact that the ADF List Binding prepares its list of valid choices (including the automatically-added "null" entry with translatable label) during the prepareModel phase of the lifecycle, and typically avoids recalculating the list during the prepareRender phase. But if we change the preferred locale between the prepareModel and the prepareRender phases, we need to force the list bindings with translatable null strings to recalculate their list of valid values.

I've updated my example #95 to accommodate having this work correctly. This required changing the implementation from using a JSF View Handler to performing that work in a custom FacesPageLifecycle class in an overridden prepareRender() method instead. Please re-download the example zip to experiment with the improved implementation.

And thanks to Jack for finding this little issue!


12:35:33 PM    



© Copyright 2008 Steve Muench.