2 Replies Latest reply on Aug 5, 2010 7:46 AM by Rene Gritsch

    <a4j:support with ontabenter, how to skip validation phase

    Rene Gritsch Newbie

      Hi,

       

      i´ve the problem that i need to change the tabs with switchType client logic and additional to set the current

      selected tab to my managed bean.

       

      <rich:tab disabled="#{not model.kfz.available}" id="ID2F0F94A0" label="Kfz" switchType="client">
                  <a4j:support ajaxSingle="true" event="ontabenter" action="#{tabController.setCurrentTabName('ID58EDF4C8','ID2F0F94A0')}"/>

      This works fine, but i´m not able to skip the validation phase. What can i do here? Use <a4:region ??

       

      Thnx

      René

        • 1. Re: <a4j:support with ontabenter, how to skip validation phase
          Ilya Shaikovsky Master

          In general with AjaxSingle = true only current component is processed.

           

          But in this case you mean that tab processed with all the content? then try to use not support but jsFucntion like:

          <form>
                  <a4j:jsFunction ajaxSingle="true" event="ontabenter" action="#{tabController.setCurrentTabName}">
                    <f:param name="param1">
               </a4j:jsFunction>
          
          <rich:tabPanel>
          ...
           <rich:tab disabled="#{not model.kfz.available}" id="ID2F0F94A0" label="Kfz" switchType="client" ontabenter="storeTab('ID58EDF4C8','ID2F0F94A0')">
           
          ....
          

          In that case do not forget to add code for parameter getting from requestMap in action.

          • 2. Re: <a4j:support with ontabenter, how to skip validation phase
            Rene Gritsch Newbie

            Hi,

             

            i got it to work, but i needed to add my changeRichTab script, because otherwise the tab change is not performed

             

            function changeRichTab(tabPanelID, tabID) {
                var fullIDForTabPanel = jQuery("[id$=" + ":"+ tabPanelID + "]").attr("id");
                var fullIDForTab = jQuery("[id$=" + ":" + tabID + "]").attr("id");
                RichFaces.switchTab(fullIDForTabPanel, fullIDForTab, tabID);

            }

             

                 <rich:tabPanel id="ID58EDF4C8" switchType="client">

                 <rich:tab ontabenter="changeRichTab('ID58EDF4C8','ID2F0F94A0');storeTab('ID58EDF4C8','ID2F0F94A0')" disabled="#{not model.kfz.available}" id="ID2F0F94A0" label="Kfz" switchType="client">
                         <a4j:jsFunction name="storeTab" ajaxSingle="true" event="ontabenter" action="#{tabController.setCurrentTabName}">
                              <f:param name="tabpanelId"/>
                              <f:param name="tabId"/>
                        </a4j:jsFunction>

             

             

            But now i have another problem, as soon as call the "storeTab" function, i get the values in java and tab is switched for about 1-2sec.

            but then switches back to the old tab ?!?