5 Replies Latest reply on Apr 25, 2007 4:22 AM by liumin hu

    bug when a4j:include and rich:tab?

    liumin hu Master

      I have a template:leftcenterright.xhtml

       <a4j:outputPanel layout="block" id="detailFilterDiv" >
       <ui:insert name="left">
       </ui:insert>
       </a4j:outputPanel>
      
       <a4j:outputPanel layout="block" id="detailRestoreDiv" >
       <ui:insert name="menu">
       </ui:insert>
       </a4j:outputPanel>
      
       <a4j:outputPanel layout="block" id="detailResultDiv" >
       <ui:insert name="right">
       </ui:insert>
       </a4j:outputPanel>
      


      tab1.xhtml,tab2.xhtml,tab3.xhtml use this template.

       <rich:tabPanel switchType="ajax" >
       <rich:tab id="tab1" label="tab1" >
       <a4j:include viewId="/tab1.xhtml" />
       </rich:tab>
       <rich:tab id="tab2" label="tab2" >
       <a4j:include viewId="/tab2.xhtml" />
       </rich:tab>
       <rich:tab id="tab3" label="tab3" >
       <a4j:include viewId="/tab3.xhtml" />
       </rich:tab>
       </rich:tabPanel>
      


      when use a4j:include, i have not error duplicate id for detailFilterDiv,detailRestoreDiv and detailResultDiv.(i got a error when use ui:include)

      the problem is in one of 3 tab page, if i demand to refresh detailResultDiv, the content in 3 tab pages is refreshed. all getter is called. Is it normal?

        • 1. Re: bug when a4j:include and rich:tab?
          Sergey Smirnov Master

          are you using RichFaces 3.0.0 or 3.0.1 snapshot (the same question about Ajax4jsf)?

          • 2. Re: bug when a4j:include and rich:tab?
            liumin hu Master


            i'm using vajax4jsf 1.1.1 snapshot and richfaces-3.0.1 snapshot. but i'm not sure they are the latest. i have downloaded them for some weeks.

            • 3. Re: bug when a4j:include and rich:tab?
              Ilya Shaikovsky Master

              What is the facelets version you've used? Right now I'm able to use ui:include inside tabs.

              My Env:
              RF and A4j current SNAPSHOTS
              JSF 1.2_04
              Facelets 1.1.12

              • 4. Re: bug when a4j:include and rich:tab?
                liumin hu Master


                myfaces 1.1.5
                facelet 1.1.12

                • 5. Re: bug when a4j:include and rich:tab?
                  liumin hu Master

                  hi,

                  i found where comes the problem, it is because of the position of form, but i dont know why.

                  when i place only one h:form around the rich:tabpanel, or a h:form for a a4j:include. there is no problem.

                  <h:form>
                  <rich:tabPanel switchType="ajax" >
                   <rich:tab id="tab1" label="tab1" >
                   <a4j:include viewId="/tab1.xhtml" />
                   </rich:tab>
                   <rich:tab id="tab2" label="tab2" >
                   <a4j:include viewId="/tab2.xhtml" />
                   </rich:tab>
                   <rich:tab id="tab3" label="tab3" >
                   <a4j:include viewId="/tab3.xhtml" />
                   </rich:tab>
                   </rich:tabPanel>
                  </h:form>
                  


                  or

                  <rich:tabPanel switchType="ajax" >
                   <rich:tab id="tab1" label="tab1" >
                   <h:form>
                   <a4j:include viewId="/tab1.xhtml" />
                   </h:form>
                   </rich:tab>
                   <rich:tab id="tab2" label="tab2" >
                   <h:form>
                   <a4j:include viewId="/tab2.xhtml" />
                   </h:form>
                   </rich:tab>
                   <rich:tab id="tab3" label="tab3" >
                   <h:form>
                   <a4j:include viewId="/tab3.xhtml" />
                   </h:form>
                   </rich:tab>
                   </rich:tabPanel>
                  


                  but if the form is in the file included, the problem appears.

                  <?xml version="1.0" encoding="ISO-8859-1"?>
                  
                  <ui:composition template="/template/leftcenterright.xhtml"
                   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" >
                  <ui:define name="left">
                   <h:form>
                   <h:inputText id="aa" value="#{bean.prop1}" />
                   </h:form>
                  </ui:define>
                  </ui:composition>
                  
                  


                  Any explanation? maybe the a4j forgets the id added by a4j:include when rebuilding the component tree?

                  thanks