1 Reply Latest reply on Jun 5, 2009 2:36 PM by nbelaevski

    a4j:commandLink and f:param question

    meetoblivion

      So I'm not sure if I'm just doing this wrong or what.

      I currently have the following component on facelet:

      <a4j:commandLink actionListener="#{taskExecutor.delete}" value="Delete" reRender="tasks,results">
      <f:param name="imageId" value="#{image.imageId}" /></a4j:commandLink>


      Which just calls a backing bean's actionListener that's just defined

      public void delete(ActionEvent ae)


      Ican't seem to get the imageId to come through though. The generated HTML has its value, but it's not in the attribute map when i get the component in the action event. I went ahead and did this to my code:

      UIComponent comp = ae.getComponent();
      logger.error(comp.getClass().getCanonicalName());
      Map<String,Object> attributes = comp.getAttributes();
      logger.error(attributes);
      Set<String> attrK = attributes.keySet();
      logger.error("See key/value pairs:");
      for(String attr :attrK) {
      logger.error(String.format("Key: %s Value: %s",attr,attributes.get(attr)));
      }


      and all i see in the output:

      14:00:25,865 ERROR [TaskExecutor] org.ajax4jsf.component.html.HtmlAjaxCommandLink
      14:00:25,865 ERROR [TaskExecutor] javax.faces.component.UIComponentBase$AttributesMap@80403012
      14:00:25,865 ERROR [TaskExecutor] See key/value pairs:
      14:00:25,866 ERROR [TaskExecutor] Key: com.sun.facelets.MARK_ID Value: -595634370_2_186339d8
      


      Which makes me think I'm getting the wrong component somewhere. Any ideas?