2 Replies Latest reply on Oct 9, 2009 4:56 PM by ambrish_kumar

    Can I use two <a:status> images for a single form

    ambrish_kumar

      Hi Everyone,


      I have a form and I want that when I fill the form then for events like onBlur,onChange an image should display in front of that control, but when I submit the form then some different image should display in middle of the form.


      How can I define two different images for <a:status>.


      Is there any other way for doing the same ?.



      Thanks & Regards


      Ambrish

        • 1. Re: Can I use two <a:status> images for a single form
          tmalatinszki

          Hi Ambrish,


          As far as I know You can't change status images dynamically, but You can use different a4j:status elements for each components/events.


          Here's an example how it works:


          <a4j:form id="testFrom" ajaxSubmit="true">
          
            <h:inputText value="">
              <a4j:support event="onblur" status="blurStatus"/>
            </h:inputText>
            <a4j:commandButton value="Submit" status="submitStatus"/>
          
            <a4j:region>
              <a4j:status id="blurStatus">
                <f:facet name="start">
                  <h:graphicImage value="/images/onblur.gif"/>
                </f:facet>
              </a4j:status>
            </a4j:region>
          
            <a4j:region>
              <a4j:status id="submitStatus">
                <f:facet name="start">
                  <h:graphicImage value="/images/submit.gif"/>
                </f:facet>
              </a4j:status>
            </a4j:region>
          
          </a4j:form>



          In this case if there is an onblur event on the h:inputText tag the onblur.gif will appear, but if You click on submit button the submit.gif will do.


          Regards,
          Tamas



          • 2. Re: Can I use two <a:status> images for a single form
            ambrish_kumar

            Hi Tamas,


            Thanks for the reply.


            My issue is solved.


            Regards


            Ambrish