1 Reply Latest reply on Jul 27, 2011 6:49 AM by iabughosh

    submit a form from toolbar icon

    vins76

      Hi all,

      I have a page with a toolbar .

       

      <rich:toolbar height="26px">

         <rich:toolbarGroup>            

          <h:graphicImage value="/images/icons/create_doc.gif" styleClass="pic" alt="create_doc" />  

           <a4j:commandLink id="cbutton" action="#{ciPageBean.save}" reRender="res">          

           <h:graphicImage value="/images/icons/save.gif" />

          </a4j:commandLink>

      ......

       

       

      <h:form>

        <h:outputText value="Code:" />                

        <h:inputText value="#{ciPageBean.code}" />

        <h:outputText value="Description:" />                

        <h:inputText value="#{ciPageBean.description}" />

      </h:form>

       

      Command Link is outside the form.

      Clicking on cButton command link, the method save of ciPageBean is called. But code and description are not populated.

       

      Can I submit a form from commandLink?

       

      Thanks in advance

        • 1. Re: submit a form from toolbar icon
          iabughosh

          yes you can but the form is required to popualte the data :

           

           

          <h:form id="form1">

          <rich:toolbar height="26px">

             <rich:toolbarGroup>           

              <h:graphicImage value="/images/icons/create_doc.gif" styleClass="pic" alt="create_doc" /> 

               <a4j:commandLink id="cbutton" action="#{ciPageBean.save}" reRender="res">         

               <h:graphicImage value="/images/icons/save.gif" />

              </a4j:commandLink>

          ......

          </h:form>

           

          <h:form id="form2">

            <h:outputText value="Code:" />               

            <h:inputText value="#{ciPageBean.code}" />

            <h:outputText value="Description:" />               

            <h:inputText value="#{ciPageBean.description}" />

          </h:form>