1 Reply Latest reply on Apr 25, 2009 9:47 AM by dxxvi

    Attaching a4j:support to rich:tab label?

    arw

      Hey,


      I have a rich:tabPanel which uses 'client' switching type for business reasons and cannot use ajax or server in this context.


      The problem I'm having is with recording the state the tab panel is in. ValueChangeListener doesn't immediately fire when switching on the client side (not a surprise) so my first thought was to add an a4j:support to the rich:tab that would record the state of the tab panel on-click of the tab.


      Problem is it seems to attach the event to the body of the tab. Again this isn't terribly unexpected so I thought I would do this:


                                             <rich:tab name="location-sets">
                                                  <f:facet name="label">
                                                      <a4j:support action="#{ ... records state ...}" ajaxSingle="true" event="onclick" />
                                                      <h:outputText value="My Location Sets" />
                                                  </f:facet>
                                                  .... tab content ....
                                              </rich:tab>


      Frustratingly the onclick event is still attached to the actual tab body, not the label.


      Am I missing something here? Is there a different facet that I should use to attach an event to the label (the little header thing that sticks above the tab body)?



        • 1. Re: Attaching a4j:support to rich:tab label?

          Try this


          <rich:tabPanel switchType="client">
              <a4j:support event="ontabchange" action="#{util.doNothing}" ajaxSingle="true"/>
              <rich:tab>
                  <f:facet name="label">Tab 1</f:facet>
                  the 1st tab
              </rich:tab>
              <rich:tab>
                  <f:facet name="label">Tab 2</f:facet>
                  the 2nd tab
              </rich:tab>
          </rich:tabPanel>



          I haven't tried binding the tabPanel to a component to check which tab we are on.