14 Replies Latest reply on Dec 29, 2010 5:28 AM by deeps83

    tabs not rendered properly.

    deeps83

      Hi,

       

      I have a tabpanel in my xhtml page as given below :

       

      <ui:define name="centerdata">  

       

              <a:outputPanel id="pVTabs">
                  <div
                      style="height: 210px; padding-left: 20px; padding-right: 20px; background-color: white;">
                  <a:region id="apvregion">
                      <rich:tabPanel id="tabs" switchType="ajax" height="200px"
                          selectedTab="#{plantview.selectedTab}" styleClass="tab-subheader"
                          inactiveTabClass="tab-subheader-inactive" activeTabClass="tab-subheader-active">
                          <a:support event="ontabchange" action="#{plantview.clearView()}"
                              reRender="chartGrid,qualitytable,push" limitToList="true"></a:support>
                          <rich:tab label="Metrics" id="qdTab" rendered="true"
                              switchType="ajax" name="qdTab">
                              <rich:panel style="padding-top: 10px;padding-bottom:10px"
                                  ...................................
                                  ...................
                              </rich:panel>
                          </rich:tab>

       

                          <rich:tab label="Quality Data" id="metTab" switchType="ajax"
                              rendered="true" name="metTab">
                              ......................
                              ...................
                          </rich:tab>

       

       

       

                          <rich:tab label="Dependency Data"
                              rendered="#{plantview.renderDepData}" id="ddTab" switchType="ajax" name="ddTab">
                              ................................
                              ....................
                          </rich:tab>
                          <rich:tab label="Current Monitors"
                              rendered="#{plantview.renderMonitorTab}" id="mdTab"
                              switchType="ajax" name="mdTab">
                              .................
                              ................
                          </rich:tab>

       


                          <rich:tab label="Current Reports" style="border:0" id="rdtab"
                              switchType="ajax" rendered="true" name="rdtab">
                              ...................
                              ......................

       

                          </rich:tab>
                          <rich:tab label="Stations"
                              rendered="#{plantview.renderStationsTab}" id="stationstab"
                              switchType="ajax" name="stationstab">
                              ..............
                              ................
                          </rich:tab>

       

                      </rich:tabPanel>
                      <a:status onstart="Richfaces.showModalPanel('astartpanel')"
                          onstop="Richfaces.hideModalPanel('astartpanel')"
                          for="apvregion">
                      </a:status>

       

                  </a:region></div>

       

              </a:outputPanel>     

       

          </ui:define>

       

      But if I keep on switching the tabs , at some point of time some tabs will not be rendered.Sometimes when this happens I will get an info in the console as :

       

      inclId:tabs: tab panel [@selectedTab=ddTab] has no enabled or rendered tab with such name. Tab: rdtab will be used instead!

       

      But I have seen that the value of the rendered attribute is true only for all the tabs which are not rendered.

       

      What can be the reason for this.If anyone have any idea please share.

       

      I am using :

       

      Richfaces 3.3.3Final.

      JSF 1.2

      Seam 2.2.0 GA

      JBoss 4.2.3 GA.

      Facelets 1.1.15

       

      Thanks,

      Deeps.

        • 1. Re: tabs not rendered properly.
          deeps83

          Hi,

          It will be great if some one can give me a reply for this.I tried everything that I can.But the issue is still there.Please help.

           

          thanks,

          Deeps.

          • 2. Re: tabs not rendered properly.
            ilya_shaikovsky

            Objects which holds rendered properties should live longer than request(session or conversation scoped)

            • 3. Re: tabs not rendered properly.
              deeps83

              Hi,

               

              Thanks for the response.Actually the object which holds the rendered property is session scoped only.

               

              Thanks,

              Deeps.

              • 4. Re: tabs not rendered properly.
                ilya_shaikovsky

                and what about plantview.selectedTab? maybe it's getting reseted somehow?

                • 5. Re: tabs not rendered properly.
                  deeps83

                  I don't think so thats happening. Even if the selected tab is getting reseted it should only affet the tab which is being selected wright?How can some tabs rendered in the tabpanel with rendered=true dissappear?

                   

                  deeps.

                  • 6. Re: tabs not rendered properly.
                    ilya_shaikovsky

                    seems could only advise to check in debugger values for selected tab and dynamic rendering properties during failed request.

                    • 7. Re: tabs not rendered properly.
                      deeps83

                      Hi,

                       

                      I have debugged and seen that the rendered property is true for the invisible tabs.And the selected tab is also set properly.So I could not understand what is happening.It is like sometimes when I click on the tab labels(switch between the tabs) some tabs will just disappear and when I click once again on any of the tablabels the tabs which disappeared last time will be visible.In between the tabs switching I am not changing the rendered property of any of the tabs.Since the object which holds the rendered property is having session scope the value which was set to previously should be there wright?

                       

                      The behaviour is not consistent.It happens only sometimes.I replced the attributes which holds the rendered property for the tabs with function calls which return true or false based on certain conditions.Felt so after that the frequecny of the issue is reduced.But still issue is there.

                       

                      I tried removing the 'ontabchange ajax support' for th tabpanel and tried switching the tabs.And it worked fine.But since the issue is not consistent I am not sure whether removing ajax support have solved the issue.But do you think that can be the reason.

                       


                      And another thing I have noticed is, an issue I am getting when the ajax support is there is also no there on removing it.

                       


                      The issue is :

                       

                      I am getting the message:
                        

                      drag:Element with [inclId:qdform:qualitytable_hdrag_qdColumn1] ID was not found in the DOM tree.  Probably element has no client ID or client ID hasn't been written.  DnD's disabled. Check please! 

                      in explorer followed by a number of similar messages as pop ups,and I have to keep on clicking ok.I am getting this for extendeddatatable.But the UI will be updated properly.
                       
                      I have read in some dicussions that this happens if ids are not set properly for the components.But I have given id for all the components,That can be seen from the messsage itself.

                       

                      Hope so this details can you give some idea regarding the issue.

                       

                      Thanks,

                      Deeps.

                      • 8. Re: tabs not rendered properly.
                        ilya_shaikovsky

                        Hey, sorry I didn't noticed that support.

                         

                        At first I guess that it''s action actually causes that behavior. And main problem with that - you have ajax switch mode for tabPanel and ajax support on switch. Concurrent requests appears and their order is unpredictable. I think you should remove it and just execute the code you need when tabs switched in tabPanel's valueChangeListener.

                        • 9. Re: tabs not rendered properly.
                          deeps83

                          hi,

                           

                          Thanks For the answer.But I want to rerender another region(a panel grid below the tabpanel) after calling this tabchange or valuchangelistener fn.But on tabpanel valuechangelistener I have no option to rerender .

                           

                          The main reason why I have gone for ajax switchtype is to keep track of the selectedtab. Setting and getting of selectedtab will work only if switchtype is ajax wright?

                           

                          Thanks,

                          Deeps.

                          • 10. Re: tabs not rendered properly.
                            deeps83

                            Hi,

                             

                            Outputpanels with ajaxrendered=true also won't be rerendered in case of  valuechangelistener wright? Is there any other way in which I can attain the following requirements avoiding concurrent requests issues:

                             

                            1. Keep track of the selected tab.

                            2.call a function on tab change and rerender some other components.

                             

                            Thnaks,

                            Deeps.

                            • 11. Re: tabs not rendered properly.
                              ilya40umov

                              You can add a call of a4j:jsFunction on this event:

                              ontabchangefalsefalsejavax.el.ValueExpression
                              (must evaluate to java.lang.String)
                              The client-side script method to be called before a tab is changed

                              • 12. Re: tabs not rendered properly.
                                deeps83

                                Hi,

                                Thanks for the reply.

                                But I guess this is similar to giving ajax support ontabchange.Hence it is having the same issue as using ajax support ontabchange.

                                 

                                Thanks,

                                Deeps.

                                • 13. Re: tabs not rendered properly.
                                  ilya40umov

                                  You can switch to switchType="client" and use ontabchage event. Like this:

                                  <a4j:jsFunction id="tabChangeFn" name="tabChangeFn" reRender="whatever you need">

                                    <a4j:actionparam name="name"

                                        value="name"

                                        assignTo="#{bean.selectedTab}"

                                        noEscape="true" />

                                  </a4j:jsFunction>

                                  <a4j:jsFunction id="tabChangeFn" name="tabChangeFn">
                                  <a4j:actionparam name="name"
                                       value="name"
                                       assignTo="#{deviceInformationViewBean.selectedTab}"
                                       noEscape="true" />
                                  </a4j:jsFunction>

                                   

                                  <rich:tabPanel id="panel" switchType="client" selectedTab="#{someBean.selectedTab}" ontabchange="tabChangeFn(event.enteredTabName)">

                                   

                                  Thus a4j:jsFunction can rerender whatever you want.

                                   

                                  • 14. Re: tabs not rendered properly.
                                    deeps83

                                    Hi,

                                     

                                    Hope so my issue is solved.I have given a requestdelay for the tabpanel ontabchange ajax support.Now It seems to be working fine.Thanks to all.

                                     

                                    Deeps.