ICEfaces
  1. ICEfaces
  2. ICE-2193

PanelCollapsible actionListener fires twice when collapsing

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.1, 1.7, 1.7.1
    • Fix Version/s: 1.7.2
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      OS X 10.4.10
      Eclipse 3.3.0
      Java 5


      Description

      When closing a panelCollapsible it seems to fire the actionListener two times.

      Page:
      <ice:form>
          <ice:panelCollapsible actionListener="#{test.testAction}">
              <f:facet name="header">
                  <ice:panelGroup>
                      <ice:outputText value="Header" />
                  </ice:panelGroup>
              </f:facet>
              <ice:panelGroup>
                  <ice:outputText value="Some test text" />
              </ice:panelGroup>
          </ice:panelCollapsible>
      </ice:form>

      Backing Bean:
      public class Test {
           
          private int _counter;
           
          public Test(){
          }
          
          public void testAction(ActionEvent event) {
              _counter++;
              System.out.println("Count is " + _counter);
          }
      }

        Activity

        Chris Keefer created issue -
        Hide
        Chris Keefer added a comment -

        Since I had some time on my hands, I wanted to take a quick look at why the panelCollapsible was behaving improperly. Here is what I have found. The method processDecodes calles super.processDecodes only when the component is in its "expanded" state. From what I see and understand from the documentation UIComponentBase.processDecodes calls the decode method of this component. There is an explicit call to the decode method on line 221. This is why is fires the actionListener two times. By moving the decode method call into the else block you eliminate the second call to the decode method.

        --Chris

        Show
        Chris Keefer added a comment - Since I had some time on my hands, I wanted to take a quick look at why the panelCollapsible was behaving improperly. Here is what I have found. The method processDecodes calles super.processDecodes only when the component is in its "expanded" state. From what I see and understand from the documentation UIComponentBase.processDecodes calls the decode method of this component. There is an explicit call to the decode method on line 221. This is why is fires the actionListener two times. By moving the decode method call into the else block you eliminate the second call to the decode method. --Chris
        Hide
        Chris Keefer added a comment -

        Patch file for my fix.

        --Chris

        Show
        Chris Keefer added a comment - Patch file for my fix. --Chris
        Chris Keefer made changes -
        Field Original Value New Value
        Attachment PanelCollapsible.patch [ 10700 ]
        Philip Breau made changes -
        Assignee Philip Breau [ philip.breau ]
        Michael Thiem made changes -
        Michael Thiem made changes -
        Affects Version/s 1.7.1 [ 10122 ]
        Affects Version/s 1.7 [ 10080 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #16935 Thu Jun 19 10:41:22 MDT 2008 adnan.durrani Fix for ICE-2193 (PanelCollapsible actionListener fires twice when collapsing)
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelcollapsible/PanelCollapsible.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #16936 Thu Jun 19 10:41:38 MDT 2008 adnan.durrani Fix for ICE-2193 (PanelCollapsible actionListener fires twice when collapsing)
        Files Changed
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/component/src/com/icesoft/faces/component/panelcollapsible/PanelCollapsible.java
        Hide
        Adnan Durrani added a comment -

        trunk: revision 16935
        branch 1.7: revision 16936

        Show
        Adnan Durrani added a comment - trunk: revision 16935 branch 1.7: revision 16936
        Adnan Durrani made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.7.2 [ 10130 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 1.7.2RC1 [ 10140 ]
        Fix Version/s 1.7.2 [ 10130 ]
        Ken Fyten made changes -
        Fix Version/s 1.7.2 [ 10130 ]
        Fix Version/s 1.7.2RC1 [ 10140 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Philip Breau [ philip.breau ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Chris Keefer
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: