javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2283

System Events Example App: Dynamic Components

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Works as designed
    • Affects Version/s: 2.0.7, 2.1.6
    • Fix Version/s: 2.1.9, 2.2.0-m03
    • Component/s: None
    • Labels:
      None

      Description

      When using partial state saving, dynamic UISelectItem / UISelectItems are not restored upon postback. We need to investigate if UISelectItem and UISelectItems should be added to the list of dynamic actions in the first place. Note get the test application from issue 1826, the addressbook-faces2.war attachment.

        Issue Links

          Activity

          Hide
          Manfred Riem added a comment -

          Closing as "Works as designed" but showing when the issue was really fixed as a consequence of fixing #1826. Note the requested JavaDoc clarification is being tracked as a spec issue.

          Show
          Manfred Riem added a comment - Closing as "Works as designed" but showing when the issue was really fixed as a consequence of fixing #1826. Note the requested JavaDoc clarification is being tracked as a spec issue.
          Hide
          arjan tijms added a comment -

          After further testing, it appears there are some points of contention between how MyFaces and Mojarra handle this. There seem to be cases, when using MyFaces 2 with RichFaces Ajax processing, that UIForm.createUniqueId will just return 'j_id3' (or whatever) without also incrementing the global value returned by UIViewRoot.createUniqueId. This leads to duplicate id conflicts.

          With the new insight, is this issue now also resolved? Or do you use UIViewroot for MyFaces and UIForm for Mojarra now?

          Show
          arjan tijms added a comment - After further testing, it appears there are some points of contention between how MyFaces and Mojarra handle this. There seem to be cases, when using MyFaces 2 with RichFaces Ajax processing, that UIForm.createUniqueId will just return 'j_id3' (or whatever) without also incrementing the global value returned by UIViewRoot.createUniqueId. This leads to duplicate id conflicts. With the new insight, is this issue now also resolved? Or do you use UIViewroot for MyFaces and UIForm for Mojarra now?
          Hide
          Manfred Riem added a comment -

          You should use the nearest UINamingContainer to get a truly unique id within the scope of a UINamingContainer. So you would walk up the tree, get the first UINamingContainer and ask it for a unique id. That should work in both MyFaces and Mojarra.

          Show
          Manfred Riem added a comment - You should use the nearest UINamingContainer to get a truly unique id within the scope of a UINamingContainer. So you would walk up the tree, get the first UINamingContainer and ask it for a unique id. That should work in both MyFaces and Mojarra.
          Hide
          arjan tijms added a comment -

          I hear you, that should work, but I'm still concerned about the statement kennardconsulting made that MyFaces in combination with RichFaces has a problem with that approach. If this is indeed true, then it's of course a MyFaces issue and neither a JSF Spec or Mojarra problem.

          Show
          arjan tijms added a comment - I hear you, that should work, but I'm still concerned about the statement kennardconsulting made that MyFaces in combination with RichFaces has a problem with that approach. If this is indeed true, then it's of course a MyFaces issue and neither a JSF Spec or Mojarra problem.
          Hide
          kennardconsulting added a comment -

          I kind of dodged the issue, since I needed something that would work on JSF1 and JSF2, and didn't want to chase people any further. I'll leave that fight for somebody else

          My 'dodge' is here (FacesUtils.createUniqueId):

          https://github.com/metawidget/metawidget/blob/master/modules/faces/core/src/main/java/org/metawidget/faces/FacesUtils.java

          It seems to work for my purposes, but I'd appreciate anybody's feedback if this is considered 'unsafe'.

          Show
          kennardconsulting added a comment - I kind of dodged the issue, since I needed something that would work on JSF1 and JSF2, and didn't want to chase people any further. I'll leave that fight for somebody else My 'dodge' is here (FacesUtils.createUniqueId): https://github.com/metawidget/metawidget/blob/master/modules/faces/core/src/main/java/org/metawidget/faces/FacesUtils.java It seems to work for my purposes, but I'd appreciate anybody's feedback if this is considered 'unsafe'.

            People

            • Assignee:
              Manfred Riem
              Reporter:
              Manfred Riem
            • Votes:
              6 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 15 minutes
                15m