2 Replies Latest reply on Nov 18, 2008 6:31 AM by nimo stephan

    set value by event ontabenter (like actionparam)

    nimo stephan Master

      I have this:

      <rich:tabPanel switchType="ajax" selectedTab="#{thisTab}">
      
      <rich:tab id="tab1" name="Tab1">
      ..
      </rich:tab>
      
      <rich:tab id="tab2" name="Tab2">
      <s:link view="/otherPage.xhtml" value="Other Page"/>
      </rich:tab>
      
      </rich:tabPanel>


      The default value of #{thisTab} is tab1.

      I want, that when I click the tab2, then my value #{thisTab} should change to tab2.

      This works:

      <rich:tab id="tab2" name="Tab2">
      <s:link view="/otherPage.xhtml" value="Other Page">
      <a4j:actionparam name="setTab" value="tab2" assignTo="#{thisTab}"/>
      </rich:tab>


      But I cannot use a4j:actionparam, as I have not always links or buttons inside my tab.

      So I need something like:

      <rich:tab id="tab2" name="Tab2" ontabenter="???">
      <s:link view="/otherPage.xhtml" value="Other Page"/>
      </rich:tab>


      So you see, when the event ontabenter occurs, then the value #{thisTab} should be set to tab2.

      How can I do that??