You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Thierry Buecheler <th...@buecheler.net> on 2006/01/03 09:37:53 UTC

ActionListener invoked over and over

Hi everybody

On a page which lists books I provide an "edit" Button where users can 
change informations on books:

-----
PAGE:
-----

<t:column ...

<t:commandLink id="EditBook" action="editor"
actionListener="#{referenceBean.selectReference}">
<t:outputText value="Edit" />
<f:param id="editId" name="id" value="#{reference.id}" />
</t:commandLink>

</t:column>

-----
BEAN:
-----

public void selectReference(ActionEvent event) {
...

UIParameter component = (UIParameter) 
event.getComponent().findComponent("editId");

String id = component.getValue().toString();

this.setReference(db.loadReference(id));

}

It looks like the method selectReference is invoked over and over again 
(for each column in the dataTable), which results in the fact that 
always the last reference is selected (and displayed in the editor) at 
the end.

Anybody knows why ActionListeners could be invoked more than once?

Thanks for any help!

Thierry