5 Replies Latest reply on Nov 22, 2007 3:58 AM by david.spark

    <a4j:support> not working

    rvkishore

      I am trying to get my to dynamically reload when a menu item is selected.

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:s="http://jboss.com/products/seam/taglib" lang="en"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich">
      <body>
       <div class="content2">
       <rich:panel id="richPanel" style="background-color : transparent;">
       <h:selectOneMenu valueChangeListener="#{categoryAction.subCategories}" value="#{sheet.currentCategory}" required="true">
       <a4j:support event="onchange" reRender="content2"/>
       <s:selectItems value="#{categoryAction.rootCategories}" var="cat" label="#{cat.name}" noSelectionLabel="Please Select..."/>
       </h:selectOneMenu>
       </rich:panel>
       </div>
      </body>
      </html>
      


      The select list gets loaded correctly for the first time. However nothing happens when I select an item on the list. I tried putting the action on the a4j:support but still nothing happens.

      Any ideas as to what I am doing wrong here.

      THanks in advance

        • 1. Re: <a4j:support> not working

          What is the browser? Where is the form element?

          • 2. Re: <a4j:support> not working
            rvkishore

            I modified my code

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml"
             xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:s="http://jboss.com/products/seam/taglib" lang="en"
             xmlns:a4j="http://richfaces.org/a4j"
             xmlns:rich="http://richfaces.org/rich">
            <body>
             <div class="content2">
             <a4j:form>
             <rich:panel id="richPanel" style="background-color : transparent;">
             <h:selectOneMenu value="#{sheet.currentCategory}" required="true">
             <a4j:support event="onchange" action="#{categoryAction.subCategories}"/>
             <s:selectItems value="#{categoryAction.rootCategories}" var="cat" label="#{cat.name}" noSelectionLabel="Please Select..."/>
             </h:selectOneMenu>
             </rich:panel>
             </a4j:form>
             </div>
            </body>
            </html>
            


            I still do not see my server side bean being called on a select event. I see the following errors on the console

            INFO: Facelet[/viewSheet1.xhtml] was modified @ 3:26:39 PM, flushing component a
            pplied @ 3:26:39 PM
            15:26:39,618 INFO [lifecycle] WARNING: FacesMessage(s) have been enqueued, but
            may not have been displayed.
            sourceId=j_id2:j_id3[severity=(ERROR 2), summary=(value is not valid), detail=(v
            alue is not valid)]
            15:26:43,407 ERROR [STDERR] Nov 21, 2007 3:26:43 PM com.sun.facelets.impl.Defaul
            tFacelet refresh
            INFO: Facelet[/viewSheet1.xhtml] was modified @ 3:26:43 PM, flushing component a
            pplied @ 3:26:41 PM
            


            what I am doing wrong?


            Thanks in advance

            • 3. Re: <a4j:support> not working

              put <rich:messages /> somewhere on the page

              • 4. Re: <a4j:support> not working
                rvkishore

                Thanks for the prompt replies.. I am not getting any Facesmessages errors now. But I see the following on the console

                category1_.id where category0_.id=?
                15:48:34,755 ERROR [STDERR] Nov 21, 2007 3:48:34 PM com.sun.facelets.impl.Defaul
                tFacelet refresh
                INFO: Facelet[/viewSheet1.xhtml] was modified @ 3:48:34 PM, flushing component a
                pplied @ 3:48:34 PM
                15:48:57,018 ERROR [STDERR] Nov 21, 2007 3:48:57 PM com.sun.facelets.impl.Defaul
                tFacelet refresh
                INFO: Facelet[/viewSheet1.xhtml] was modified @ 3:48:57 PM, flushing component a
                pplied @ 3:48:36 PM
                


                And my action is still not fired for the bean on a select.

                Thanks in advance

                • 5. Re: <a4j:support> not working

                  In your modified code you no longer have reRender="content2" specified