1 Reply Latest reply on Jan 7, 2008 3:33 PM by Jason Young

    Position of click in commandButton with image

    Stephan Grüter Newbie

      Hi!

      Is it possible, to get the position of the click in a ajax4jsf commandButton image:

      <a4j:form id="karteForm" ajaxSubmit="true">
       <a4j:commandButton image="Kartengenerator"
       ajaxSingle="true" id="karte" actionListener="#{infoBean.doAjax}"
       reRender="infoPanel" limitToList="true" immediate="true">
       </a4j:commandButton>
      </a4j:form>
      


      The non-ajax way would be to get the coordinates from ActionEvent and FacesContext like:
      FacesContext context = FacesContext.getCurrentInstance();
      String clientId = event.getComponent().getClientId(context);
      Map requestParams = context.getExternalContext().getRequestParameterMap();
      
      this.xkor = new Integer((String) requestParams.get(clientId + ".x"));
      this.ykor = new Integer((String) requestParams.get(clientId + ".y"));
      


      But this does not work here (no requestParams?).

      Is there another way to get this information from the event or context?

      Thanks for any help