The wrong tab may be displayed after a validation failure and 
serverSiteTabSwitch="false"
-----------------------------------------------------------------------------------------

         Key: TOMAHAWK-543
         URL: http://issues.apache.org/jira/browse/TOMAHAWK-543
     Project: MyFaces Tomahawk
        Type: Bug

  Components: Tabbed Pane  
    Versions: 1.1.3    
    Reporter: Paul Spencer


I have a form on a tabbed pane that validates input. When their is a validation 
error and the attribute serverSideTabSwitch on <t:panelTabbedPane> is undefined 
or set to false, the first tab is displayed, not the one with the error.

Their is a selectedIndex attribute on <t:panelTabbedPane>.  I would contend 
that the selectIndex is not getting
set/restored when serverSiteTabSwitch="false". This show up when the validation 
phase fails.

Or said another way:
  MyFaces does not know which tab the clicked button was on and it always 
display the tab
  identified by selectIndex when serverSiteTabSwitch="false" when their is a 
validation failure.

The code below will demonstrate the problem.  Click on "Server Tab 2" then 
"Submit Query".  "Server Tab 2"
is still the current table.  Now do the same with "Client Tab 2".  You will 
notice that "Client Tab 1" is
the current tab!


  <t:panelTabbedPane id="serverSideSwitch" width="100%" 
serverSideTabSwitch="true">
    <t:panelTab label="Server Tab 1">
      <h:form>
        <h:outputLabel for="tab_1_input" value="Required Value" />
        <h:inputText id="tab_1_input" required="true" />
        <h:commandButton action="submit" />
        <h:messages />
      </h:form>
    </t:panelTab>
    <t:panelTab label="Server Tab 2">
      <h:form>
        <h:outputLabel for="tab_2_input" value="Required Value" />
        <h:inputText id="tab_2_input" required="true" />
        <h:commandButton action="submit" />
        <h:messages />
      </h:form>
    </t:panelTab>
  </t:panelTabbedPane>
  <t:panelTabbedPane id="clientSideSwitch" width="100%" 
serverSideTabSwitch="false">
    <t:panelTab label="Client Tab 1">
      <h:form>
        <h:outputLabel for="ctab_1_input" value="Required Value" />
        <h:inputText id="ctab_1_input" required="true" />
        <h:commandButton action="submit" />
        <h:messages />
      </h:form>
    </t:panelTab>
    <t:panelTab label="Client Tab 2">
      <h:form>
        <h:outputLabel for="ctab_2_input" value="Required Value" />
        <h:inputText id="ctab_2_input" required="true" />
        <h:commandButton action="submit" />
        <h:messages />
      </h:form>
    </t:panelTab>
  </t:panelTabbedPane>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to