Paul, one thing to remember is that in JSF, forms are really just
organizational units rather than separate "pages" in traditional http.
About the only thing they're good for is determining the default
submit button when you hit the return key or doing partial page
validation since each form contains the rendered values of every other
form.
So the real trick here is that when you submit a particular form, you
want to set your panel tab index to the panel holding whatever form
was submitted. I haven't done anything like this so I can't give
you anything specific. However, I don't see it as a bug in the
tabbed panel -- it's behavior specific to how you've set up your
application.
On 7/13/06, Paul Spencer <[EMAIL PROTECTED]> wrote:
Gerald,
1) Each tab has it's own form.
2) Client side and server side switching behave differently.
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="serverSideSwich" 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="clientSideSwich" 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>
Paul Spencer
Gerald Müllan wrote:
> Hi Paul,
>
> If i get your question, the problem is the "normal" post via the save
> button for all the tabs, which has nothing to do with tabbedPane
> component.
>
> All the tabs are rendered to the web page, on one of them the
> validation error may occur.
> If you do the save action for all tab-pages, how shall the correct one
> be displayed?
>
> I am sure that this re-displaying of the correct tab-page is not done
> through tabbedPane, so to my mind it`s ok if the initially one is
> shown to the user.
>
> But I think there is an attribute on the component to control which
> index (the tab page) should be displayed. Maybe this is useful for
> you.
>
> cheers,
>
> Gerald
>
> On 7/10/06, Paul Spencer <[EMAIL PROTECTED]> wrote:
>> 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.
>>
>> Is this the expected behavior or a bug?
>>
>>
>>
>>
>> Paul Spencer
>>
>
>