9 Replies Latest reply on Mar 15, 2007 5:06 PM by Rachana Patel

    passing values entered by user to a4j:jsFunction

    Rachana Patel Newbie


      I have a set of <h:inputtext> <h:selectonemenu> inside one <h:panelgrid>. Inside same <h:panelgrid> I am trying to call <a4j:jsFunction>. Is it possible to pass the values which user entered in <h:inputtext> or selected in <h:selectonemenu> to <a4j:jsfunction>?
      This is wat I am implying :

      <h:panelGrid columns="1" border="0" headerClass="sect_header" footerClass="sect_footer" styleClass="pr_bold">
       <h:panelGrid columns="2" columnClasses="quickCreateSecCol1">
       <h:outputLabel value="#{msg.isellForm_QuickCreat_Country}" style="width: 70px"/>
       <h:selectOneMenu id="selectCountry" value="#{backing_CustSearchBean.currentCountry}" >
       <f:selectItem itemValue="usa" itemLabel="USA"/>
       <h:outputText value="#{msg.isellForm_QuickCreat_Fname}" style="width: 70px"/>
       <h:inputText value="#{backing_CustSearchBean.createFName}" />
       <h:outputText value="#{msg.isellForm_QuickCreat_Lname}" style="width: 70px" />
       <h:inputText value="#
      {backing_CustSearchBean.createLName}" />
      <h:outputLabel value="Save" styleClass="qBox" style="vertical-align: middle; cursor:pointer" onclick="saveData('#{backing_CustSearchBean.createFName}')"/>
      <a4j:jsFunction name="saveData" action="#{backing_CustSearchBean.saveNewCustomer}" immediate="true" >
       <a4j:actionparam name="create_name" assignTo="#{backing_CustSearchBean.createFName}"></a4j:actionparam>

      As it can be seen that I am trying to catch the values entered by user in actionparam. But this value is not available in my managed bean.

      How can I pass the values entered by user to jsFunction?

      Thanks in advance!!