myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <mkien...@gmail.com>
Subject Re: TabbedPane does not validate non-selected tabs in server side tab switching mode (Relaed to TOMAHAWK-1012)
Date Mon, 11 Jun 2007 15:31:39 GMT
That could be one way to do it, although I think there may be issues
with doing it that way -- you might end up with needing to nest forms,
which cannot be done.

I'd be doing something like this instead:

<h:form>

<t:documentBody>
  <t:panelTabbedPane>
    <t:panelTab label="Query by Date">
      <sandbox:subForm>
        ...
        <h:inputText value="#{startTime}" required="true"/>
        ...
      </sandbox:subForm>
    </t:panelTab>
    <t:panelTab label="Query by SKU">
      <sandbox:subForm>
        ...
        <h:inputText value="#{sku}" required="true"/>
        ...
      </sandbox:subForm>
    </t:panelTab>
  </t:panelTabbedPane>
</t:documentBody>

</h:form>

There are probably some other details you'll have to work out,
depending on the location of your submit button relative to the
subform.

On 6/11/07, Paul Spencer <paulsp@apache.org> wrote:
> Mike,
> In my query example, each tab contains a form, see below.  Is this what
> you are talking about?
>
> <t:documentBody>
>    <t:panelTabbedPane>
>      <t:panelTab label="Query by Date">
>        <f:form>
>          ...
>          <h:inputText value="#{startTime}" required="true"/>
>          ...
>        </f:form>
>      </t:panelTab>
>      <t:panelTab label="Query by SKU">
>        <f:form>
>          ...
>          <h:inputText value="#{sku}" required="true"/>
>          ...
>        </f:form>
>      </t:panelTab>
>    </t:panelTabbedPane>
> </t:documentBody>
>
> Paul Spencer
>
>
> Mike Kienenberger wrote:
> > I think someone else already pointed this out, but from an "ideal
> > design" point of view, the tabbed panes are for organizing information
> > visually, not for supporting partial validation.
> >
> > To me, the ideal design would be to have all tabbed panes validated,
> > just like for any other visual element, and then, if you needed
> > partial validation, make use of the subForm tag by enclosing each
> > tabbed pane.
> >
> > On 6/11/07, Paul Spencer <paulsp@apache.org> wrote:
> >> I use server side switching. Validation of non-selected tab would break
> >> many pages in my applications.  As an example, one of the applications
> >> allows the user to query a database.  Each tab is a specific type of
> >> query with it's own requirement,  i.e. "Start Time" and End Time" fields
> >> are required on the "Query by Time" and "SKU" is required on the "Query
> >> by "SKU" tab.  Forcing non-selected tab to pass validation would break
> >> this part of the application since many cases the required fields have
> >> no default value by design.
> >>
> >> I can see a case where validation of non-selected tabs is need.  As an
> >> example, a series of tab that collect customer information where each
> >> tab is a type of information, "Name" "Billing Address"  "Shipping
> >> Address"....  Whether this should be implement as a
> >> "validateNonSelectedTab" attribute on <t:panelTabbedPane> and/or
> >> <t:panelTab> is it's own discussion.
> >>
> >> Paul Spencer
> >>
> >
>
>

Mime
View raw message