1 Reply Latest reply on Mar 29, 2008 3:56 PM by Pete Muir

    Seam clickable list executing action listener mutiple times

    Brandon Brown Newbie

      I am having problems calling an action listener method from a seam link inside of an h:datatable.

      Here is my table:

           <h:dataTable id="organizations" value="#{organizations}" var="org" rendered="#{organizations.rowCount>0}" styleClass="taglib roll" width="100%">
                     <f:facet name="header">Business Name &amp; Address</f:facet>
                     <s:link id="viewOrg" value="#{org.name}" propagation="none" action="#{account.selectOrganization(org)}"/>
                     #{org.address1} <br/>
                     #{org.city}, #{org.state}  #{org.zip} <br/>
                     <f:facet name="header">Org Code</f:facet>
                     <f:facet name="header">Creation Date</f:facet>
                     <h:outputText value="#{org.creationDate}">
                          <f:convertDateTime type="date" dateStyle="medium" />

      ... and the corresponding SFSB

      public class AccountAction implements Serializable, Account {
           private EntityManager em;     
           private Log log;
           @In(required=false) @Out
           private PAAMSOrganization org;
           List<PAAMSUser> users;
           List<SalesLocation> locations;
           public void destroy() {}
           public void selectOrganization(PAAMSOrganization selectedOrg) {
                PAAMS paams = PAAMS.getInstance();
                users = selectedOrg.getUsers();
                String sql = "select * from location where org_id = ? and active_flag = ?"; 
               Query q = em.createNativeQuery(sql, SalesLocation.class); 
               q.setParameter(1, selectedOrg.getId());
               q.setParameter(2, "Y");
               locations = q.getResultList();
               for(SalesLocation sl:locations){
               org = selectedOrg;

      When I click the link from the page, it is calling selectOrganization() mutiple times.  Any help would be greatly appreciated.