7 Replies Latest reply on Jul 10, 2008 10:21 AM by tamerg

    call a:support event from jquery

    tamerg

      Hi friends,

      How can call a:support from my jquery code.

      For example I have some inputText and it have a:support with onblur event.
      When I change inputText from jQuery and trigger the onblur event from jquery but process order confused.

      When I try the call generated a4j function (starts with this A4J.AJAX.Submit(...)) from jquery no effects happens.

      Can I call a:support from jquery or any other solution for this ?

      Sincerly,

        • 1. Re: call a:support event from jquery
          daniel.soneira

          You could try something like this:

          <h:inputText onblur="customFunction" .../>
          <a4j:jsFunction name="customFunction" action="..."/>
          


          Now you can call customFunction() in your javascript code.

          Have a look at the developer manual for more information on jsFunction.

          • 2. Re: call a:support event from jquery
            tamerg

            Thank for reply this worked for one inputText but in my case I have a datatable and many inputText in that case when onblur event happend data seems to go to server but it didn't rerender the inputText.

            • 3. Re: call a:support event from jquery
              ilya_shaikovsky
              • 4. Re: call a:support event from jquery
                tamerg

                Actually my code is like this if this works I also write jQuery for trigger this javascript.

                <rich:column id="hotelPrice" width="40" styleClass="hotelPrice"">
                 <h:inputText id="price" name="price" value="#{cell.price}" onblur="updatePrice(parseFloat(this.value));" rendered="#{not cell.accomodationCell and hotelPrice.params.viewType==1}" size="6">
                
                 <!-- <a:support event="onblur"
                 action="#{cell.setUpdate(true)}"
                 reRender="price" ajaxSingle="true" eventsQueue="validation"/> -->
                 </h:inputText>
                
                
                 <a:jsFunction ajaxSingle="true" reRender="price" name="updatePrice" action="#{cell.setUpdate(true)}">
                 <a:actionparam name="param1" assignTo="#{cell.price}" />
                 </a:jsFunction>
                
                
                 </rich:column>


                • 5. Re: call a:support event from jquery
                  tamerg

                   

                  <rich:column id="hotelPrice" width="40" styleClass="hotelPrice"">
                   <h:inputText id="price" name="price" value="#{cell.price}" onblur="updatePrice(parseFloat(this.value));" rendered="#{not cell.accomodationCell and hotelPrice.params.viewType==1}" size="6">
                  
                  <!-- <a:support event="onblur" action="#{cell.setUpdate(true)}" reRender="price" ajaxSingle="true" eventsQueue="validation"/> -->
                  
                  </h:inputText>
                  
                  <a:jsFunction ajaxSingle="true" reRender="price" name="updatePrice" action="#{cell.setUpdate(true)}">
                  <a:actionparam name="param1" assignTo="#{cell.price}" /> </a:jsFunction> </rich:column>


                  • 6. Re: call a:support event from jquery
                    ilya_shaikovsky

                    sorry but could you explain why you update the same filed which send request?

                    • 7. Re: call a:support event from jquery
                      tamerg

                      Because this fields is using from other ajax requests when I didn't use
                      a:support to update other ajax request can't retrieve last value of this fields.