ICEfaces
  1. ICEfaces
  2. ICE-7236

MyFaces 2 Regression Test Failure: dynamic changes to Locale are not reflected in the loadBundle messages

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 3.0
    • Component/s: Framework, ICE-Components
    • Labels:
      None
    • Environment:
      MyFaces 2 ICEfaces 2 Nightly Regression Test

      Description

      The following nightly regressions show issues with the dynamic Locale and loadBundle when running with MyFaces 2:

      ICE-3500
      ICE-2763

      Changing the current Locale dynamically does not result in the loadBundle messages being changed.

        Issue Links

          Activity

          Deryk Sinotte created issue -
          Hide
          Deryk Sinotte added a comment -

          Linking to parent case.

          Show
          Deryk Sinotte added a comment - Linking to parent case.
          Deryk Sinotte made changes -
          Field Original Value New Value
          Link This issue blocks ICE-5868 [ ICE-5868 ]
          Hide
          Deryk Sinotte added a comment -

          Looks like the loadBundle tag does not get processed during Ajax requests so the bundle messages are never updated even when the Locale for the view root is validly changed. After doing some research and fiddling with the test case, I've adjusted ICE-3500 regression test by:

          • removing the f:loadBundle and adding the following to the faces-config.xml file:

          <resource-bundle>
          <base-name>org.icefaces.qa.test.beans.messages</base-name>
          <var>msgs</var>
          </resource-bundle>

          • wrapping the entire page markup in <f:view locale="# {testBean.locale}

            "> so that the locale is set right at the view level

          From my research it appears that f:loadBundle was never really suited for supporting dynamic changes, particularly during Ajax requests. Other frameworks (including ICEfaces) came up with their own loadBundle tags to help remedy this. The changes I've made are completely valid (and recommended) as a technique for supporting dynamic changes and work in both MyFaces and Mojarra. The ICE-2763 case is more complex but I'll try and apply a similar change there.

          Show
          Deryk Sinotte added a comment - Looks like the loadBundle tag does not get processed during Ajax requests so the bundle messages are never updated even when the Locale for the view root is validly changed. After doing some research and fiddling with the test case, I've adjusted ICE-3500 regression test by: removing the f:loadBundle and adding the following to the faces-config.xml file: <resource-bundle> <base-name>org.icefaces.qa.test.beans.messages</base-name> <var>msgs</var> </resource-bundle> wrapping the entire page markup in <f:view locale="# {testBean.locale} "> so that the locale is set right at the view level From my research it appears that f:loadBundle was never really suited for supporting dynamic changes, particularly during Ajax requests. Other frameworks (including ICEfaces) came up with their own loadBundle tags to help remedy this. The changes I've made are completely valid (and recommended) as a technique for supporting dynamic changes and work in both MyFaces and Mojarra. The ICE-2763 case is more complex but I'll try and apply a similar change there.
          Hide
          Deryk Sinotte added a comment -

          I've adjusted the test case for ICE-2763 in much the same way that I did for ICE-3500. The ice:loadBundle tags I didn't adjust, just the f:loadBundle. I also changed the bean to the setting of the Locale where necessary:

          FacesContext.getCurrentInstance().getViewRoot().setLocale(new Locale(locale));

          Both cases now work in both Mojarra and MyFaces.

          Show
          Deryk Sinotte added a comment - I've adjusted the test case for ICE-2763 in much the same way that I did for ICE-3500 . The ice:loadBundle tags I didn't adjust, just the f:loadBundle. I also changed the bean to the setting of the Locale where necessary: FacesContext.getCurrentInstance().getViewRoot().setLocale(new Locale(locale)); Both cases now work in both Mojarra and MyFaces.
          Deryk Sinotte made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Assignee Deryk Sinotte [ deryk.sinotte ]
          Ken Fyten made changes -
          Fix Version/s 3.0 [ 10241 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Deryk Sinotte
              Reporter:
              Deryk Sinotte
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: