Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
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="#
" var="item"
layout="unorderedList">
<h:column>
<h:commandLink action="#
">
<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
}