Uploaded image for project: 'MyFaces Tomahawk'
  1. MyFaces Tomahawk
  2. TOMAHAWK-335

HtmlDataList.processDecodes processes its children twice

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.1.2
    • None
    • None
    • MyFaces and Tomahawk 1.1.0 (and nightly build), Tiles

    Description

      When using commandLinks in a dataList, their action methods are executed twice. The problem seems to be caused by the processDecodes method in org.apache.myfaces.custom.datalist.HtmlDataList. This method processes the events for its children and then calls super.processDecodes, causing its superclass to process its children once more. This way two action events are queued.

      When I comment out the call to super.processDecodes it all works as it should, but I am unsure whether that might have any side effects.
      processUpdates and processValidators seem to have the same processing behaviour, I did not test them though, so I don't know if that causes any problems.

      The bug occurs in the following setup:

      <t:dataList id="orderTest"
      value="#

      {myBean.items}

      " var="item"
      layout="unorderedList">
      <h:column>
      <h:commandLink action="#

      {myBean.addItem}

      ">
      <h:outputText value="add within list" />
      </h:commandLink>
      </h:column>
      </t:dataList>

      With the following corresponding methods in my backing bean:

      public void addItem() {
      SomeObject item = (SomeObject) FacesUtils.getManagedBean("item");
      List items = getItems();
      if (item != null) {
      int pos = 0;
      for (Iterator iter = items.iterator(); iter.hasNext() && iter.next() != item; pos++) {
      }
      orderItems.add(pos + 1, newItem);
      } else

      { orderItems.add(newItem); }

      }

      Attachments

        Activity

          People

            mmarinschek Martin Marinschek
            nkrijnen Nico Krijnen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: