ICEfaces
  1. ICEfaces
  2. ICE-6418

PushButton updateProperties javascript call never applied

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Beta2
    • Fix Version/s: 2.0.1
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      ACE pushbutton

      Description

      There's an issue with the PushButton component in that the updateProperties method is never called when an update to the pushButton is sent.

      I've found the doUpdate method call in jsf.js where updates are applied to the elements. This method gets called twice, once for each <update> element in the payload.

      There is an issue with the id in the updateProperties call, which is clientId, not matching the id of the button in the original markup, which is clientId + "_button" This causes the doUpdate method to throw a javascript Error, and the script update is ignored.

      But changing the id of the button doesn't work because it seems like the original span hierarchy is being replaced with just the button, which makes the script node unable to find the enclosing div. It's a little unclear in there as its difficult to debug jsf.js as its formatted all in one line in the javascript debugger.

      I think the solution is to correct the ids of the elements, and apply the update at the right level.

        Issue Links

          Activity

          Greg Dick created issue -
          Greg Dick made changes -
          Field Original Value New Value
          Salesforce Case []
          Fix Version/s 2.0.1 [ 10255 ]
          Greg Dick made changes -
          Salesforce Case []
          Affects Version/s 2.0-Beta2 [ 10242 ]
          Hide
          Greg Dick added a comment -

          The update needs to be applied for the dynamic attributes to change

          Show
          Greg Dick added a comment - The update needs to be applied for the dynamic attributes to change
          Greg Dick made changes -
          Link This issue blocks ICE-6352 [ ICE-6352 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #23774 Mon Jan 10 18:16:03 MST 2011 greg.dick ICE-6418 change id of button to what YUI eventually munges it to for updates
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/pushbutton/PushButtonRenderer.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #23775 Mon Jan 10 18:17:11 MST 2011 greg.dick ICE-6418 reset component if hashcode changes
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/ace/component/resources/org.icefaces.component.pushbutton/pushbutton.js
          Ken Fyten made changes -
          Salesforce Case []
          Security Private [ 10001 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #23817 Mon Jan 17 16:56:58 MST 2011 greg.dick ICE-6418 don't define an ID for the <button> element as it's munged by YUI
          Files Changed
          Commit graph MODIFY /icefaces2/trunk/icefaces/ace/component/src/org/icefaces/component/pushbutton/PushButtonRenderer.java
          Ken Fyten made changes -
          Assignee Greg Dick [ greg.dick ]
          Hide
          Greg Dick added a comment -

          The id of the inner <button> element was being specified, and this was causing problems as YUI was replacing this element (or at least renaming it) to be something different than the original value. The first update would fail to insert the script because the first id couldn't be found, and after the first update the button actually wasn't active anymore.

          We could either define the id to match what YUI would eventually change it to (and this worked) or we could remove giving the <button> an id at all, which is likely more robust in the long term so that's the solution. We also could choose to render out the button in one of the other ways.

          With this change, it's now possible to update the button label dynamically, or to change the style.

          Show
          Greg Dick added a comment - The id of the inner <button> element was being specified, and this was causing problems as YUI was replacing this element (or at least renaming it) to be something different than the original value. The first update would fail to insert the script because the first id couldn't be found, and after the first update the button actually wasn't active anymore. We could either define the id to match what YUI would eventually change it to (and this worked) or we could remove giving the <button> an id at all, which is likely more robust in the long term so that's the solution. We also could choose to render out the button in one of the other ways. With this change, it's now possible to update the button label dynamically, or to change the style.
          Greg Dick made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Greg Dick
              Reporter:
              Greg Dick
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: