You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Andrew Robinson <an...@gmail.com> on 2006/06/13 15:38:45 UTC

Does SubForm do anything?

I attempted to use the subForm sandbox component with absolutely no luck.

I had a page like:

<f:form>
  <t:panelGrid>
    <t:panelGroup>
      <t:inputText required="true"><f:validateLength minimum="15"
maximum="30"/></t:inputText>
    </t:panelGroup>
    <t:panelGroup>
      <s:subForm id="clickMeForm">
        <t:commandLink value="clickMe" />
      </s:subForm>
    </t:panelGroup>
  </t:panelGrid>
</f:form>

When I click the command link, I get validation errors from the input
text outside of the subform. Correct me if I am wrong, but I thought
the whole point of the subform was to stop validation and updating
outside of that component.

What am I doing wrong?

Tomahawk 1.1.2
Sandbox snapshot 2006-05-13

Thanks,
Andrew

Re: Does SubForm do anything?

Posted by Andrew Robinson <an...@gmail.com>.
Well, that (below) almost worked. I let me add the row (with that
dummy subform at the bottom of the page), but unfortunately the data
table rows still lost their values since they were not validated. The
optional validator would be idea except for that it only works with
validator IDs and not validator tags. Perhaps I can look more at that
code and find a way to do it.

-Andrew

On 6/15/06, Andrew Robinson <an...@gmail.com> wrote:
> My problem is that I would have to put a subForm around every input
> component, since the only parent component that I could wrap multiple
> elements contains the commandLink that I wouldn't want to trigger the
> validations from. Can a link in a subform NOT validate the sub for it
> is in?
> IOW is this possible?
>
> <s:subForm id="helperForm">
>   <t:inputText />
>   <t:commandLink actionFor="nothingForm" />
> </s:subForm>
>
> <s:subForm id="nothingForm" />
>
> Clicking on the link should not include helperForm - is this true?
>
> -Andrew
>
> On 6/15/06, Matthias Wessendorf <ma...@apache.org> wrote:
> > Andrew-
> >
> > you may take a look at [1].
> > This example uses two <s:subForm/> component's and the
> > <t:commandButton for="idOfSubForm"/> when you are outside of
> > any subform. When you click the first button (Show current values of
> > Person) - on a empty form_page - you'll get validations messages for
> > "First name" and "last name".
> >
> > For the second button (Show current values of Vehicle) you'll only get
> > the validation messages for "Type" and "Make".
> >
> > The example has no "global" input component (like yours).
> >
> >
> > -Matthias
> >
> > [1] http://www.irian.at/myfaces-sandbox/subForm.jsf
> >
> > On 6/15/06, Adam Winer <aw...@gmail.com> wrote:
> > > Andrew,
> > >
> > > I don't know the subform sandbox component specifically
> > > (just the Trinidad component that partly inspired it);  but I
> > > suspect that components that are outside of any subform
> > > will always process.  Components that are in a subform
> > > other than the one that was submitted will not.
> > >
> > > -- Adam
> > >
> > >
> > > On 6/13/06, Andrew Robinson <an...@gmail.com> wrote:
> > > > I attempted to use the subForm sandbox component with absolutely no luck.
> > > >
> > > > I had a page like:
> > > >
> > > > <f:form>
> > > >   <t:panelGrid>
> > > >     <t:panelGroup>
> > > >       <t:inputText required="true"><f:validateLength minimum="15"
> > > > maximum="30"/></t:inputText>
> > > >     </t:panelGroup>
> > > >     <t:panelGroup>
> > > >       <s:subForm id="clickMeForm">
> > > >         <t:commandLink value="clickMe" />
> > > >       </s:subForm>
> > > >     </t:panelGroup>
> > > >   </t:panelGrid>
> > > > </f:form>
> > > >
> > > > When I click the command link, I get validation errors from the input
> > > > text outside of the subform. Correct me if I am wrong, but I thought
> > > > the whole point of the subform was to stop validation and updating
> > > > outside of that component.
> > > >
> > > > What am I doing wrong?
> > > >
> > > > Tomahawk 1.1.2
> > > > Sandbox snapshot 2006-05-13
> > > >
> > > > Thanks,
> > > > Andrew
> > > >
> > >
> >
> >
> > --
> > Matthias Wessendorf
> > Aechterhoek 18
> > 48282 Emsdetten
> > blog: http://jroller.com/page/mwessendorf
> > mail: mwessendorf-at-gmail-dot-com
> >
>

Re: Does SubForm do anything?

Posted by Andrew Robinson <an...@gmail.com>.
My problem is that I would have to put a subForm around every input
component, since the only parent component that I could wrap multiple
elements contains the commandLink that I wouldn't want to trigger the
validations from. Can a link in a subform NOT validate the sub for it
is in?
IOW is this possible?

<s:subForm id="helperForm">
  <t:inputText />
  <t:commandLink actionFor="nothingForm" />
</s:subForm>

<s:subForm id="nothingForm" />

Clicking on the link should not include helperForm - is this true?

-Andrew

On 6/15/06, Matthias Wessendorf <ma...@apache.org> wrote:
> Andrew-
>
> you may take a look at [1].
> This example uses two <s:subForm/> component's and the
> <t:commandButton for="idOfSubForm"/> when you are outside of
> any subform. When you click the first button (Show current values of
> Person) - on a empty form_page - you'll get validations messages for
> "First name" and "last name".
>
> For the second button (Show current values of Vehicle) you'll only get
> the validation messages for "Type" and "Make".
>
> The example has no "global" input component (like yours).
>
>
> -Matthias
>
> [1] http://www.irian.at/myfaces-sandbox/subForm.jsf
>
> On 6/15/06, Adam Winer <aw...@gmail.com> wrote:
> > Andrew,
> >
> > I don't know the subform sandbox component specifically
> > (just the Trinidad component that partly inspired it);  but I
> > suspect that components that are outside of any subform
> > will always process.  Components that are in a subform
> > other than the one that was submitted will not.
> >
> > -- Adam
> >
> >
> > On 6/13/06, Andrew Robinson <an...@gmail.com> wrote:
> > > I attempted to use the subForm sandbox component with absolutely no luck.
> > >
> > > I had a page like:
> > >
> > > <f:form>
> > >   <t:panelGrid>
> > >     <t:panelGroup>
> > >       <t:inputText required="true"><f:validateLength minimum="15"
> > > maximum="30"/></t:inputText>
> > >     </t:panelGroup>
> > >     <t:panelGroup>
> > >       <s:subForm id="clickMeForm">
> > >         <t:commandLink value="clickMe" />
> > >       </s:subForm>
> > >     </t:panelGroup>
> > >   </t:panelGrid>
> > > </f:form>
> > >
> > > When I click the command link, I get validation errors from the input
> > > text outside of the subform. Correct me if I am wrong, but I thought
> > > the whole point of the subform was to stop validation and updating
> > > outside of that component.
> > >
> > > What am I doing wrong?
> > >
> > > Tomahawk 1.1.2
> > > Sandbox snapshot 2006-05-13
> > >
> > > Thanks,
> > > Andrew
> > >
> >
>
>
> --
> Matthias Wessendorf
> Aechterhoek 18
> 48282 Emsdetten
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>

Re: Does SubForm do anything?

Posted by Matthias Wessendorf <ma...@apache.org>.
Andrew-

you may take a look at [1].
This example uses two <s:subForm/> component's and the
<t:commandButton for="idOfSubForm"/> when you are outside of
any subform. When you click the first button (Show current values of
Person) - on a empty form_page - you'll get validations messages for
"First name" and "last name".

For the second button (Show current values of Vehicle) you'll only get
the validation messages for "Type" and "Make".

The example has no "global" input component (like yours).


-Matthias

[1] http://www.irian.at/myfaces-sandbox/subForm.jsf

On 6/15/06, Adam Winer <aw...@gmail.com> wrote:
> Andrew,
>
> I don't know the subform sandbox component specifically
> (just the Trinidad component that partly inspired it);  but I
> suspect that components that are outside of any subform
> will always process.  Components that are in a subform
> other than the one that was submitted will not.
>
> -- Adam
>
>
> On 6/13/06, Andrew Robinson <an...@gmail.com> wrote:
> > I attempted to use the subForm sandbox component with absolutely no luck.
> >
> > I had a page like:
> >
> > <f:form>
> >   <t:panelGrid>
> >     <t:panelGroup>
> >       <t:inputText required="true"><f:validateLength minimum="15"
> > maximum="30"/></t:inputText>
> >     </t:panelGroup>
> >     <t:panelGroup>
> >       <s:subForm id="clickMeForm">
> >         <t:commandLink value="clickMe" />
> >       </s:subForm>
> >     </t:panelGroup>
> >   </t:panelGrid>
> > </f:form>
> >
> > When I click the command link, I get validation errors from the input
> > text outside of the subform. Correct me if I am wrong, but I thought
> > the whole point of the subform was to stop validation and updating
> > outside of that component.
> >
> > What am I doing wrong?
> >
> > Tomahawk 1.1.2
> > Sandbox snapshot 2006-05-13
> >
> > Thanks,
> > Andrew
> >
>


-- 
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: Does SubForm do anything?

Posted by Andrew Robinson <an...@gmail.com>.
Ah. thanks. Hmmm that will make it more difficult...

On 6/15/06, Adam Winer <aw...@gmail.com> wrote:
> Andrew,
>
> I don't know the subform sandbox component specifically
> (just the Trinidad component that partly inspired it);  but I
> suspect that components that are outside of any subform
> will always process.  Components that are in a subform
> other than the one that was submitted will not.
>
> -- Adam
>
>
> On 6/13/06, Andrew Robinson <an...@gmail.com> wrote:
> > I attempted to use the subForm sandbox component with absolutely no luck.
> >
> > I had a page like:
> >
> > <f:form>
> >   <t:panelGrid>
> >     <t:panelGroup>
> >       <t:inputText required="true"><f:validateLength minimum="15"
> > maximum="30"/></t:inputText>
> >     </t:panelGroup>
> >     <t:panelGroup>
> >       <s:subForm id="clickMeForm">
> >         <t:commandLink value="clickMe" />
> >       </s:subForm>
> >     </t:panelGroup>
> >   </t:panelGrid>
> > </f:form>
> >
> > When I click the command link, I get validation errors from the input
> > text outside of the subform. Correct me if I am wrong, but I thought
> > the whole point of the subform was to stop validation and updating
> > outside of that component.
> >
> > What am I doing wrong?
> >
> > Tomahawk 1.1.2
> > Sandbox snapshot 2006-05-13
> >
> > Thanks,
> > Andrew
> >
>

Re: Does SubForm do anything?

Posted by Adam Winer <aw...@gmail.com>.
Andrew,

I don't know the subform sandbox component specifically
(just the Trinidad component that partly inspired it);  but I
suspect that components that are outside of any subform
will always process.  Components that are in a subform
other than the one that was submitted will not.

-- Adam


On 6/13/06, Andrew Robinson <an...@gmail.com> wrote:
> I attempted to use the subForm sandbox component with absolutely no luck.
>
> I had a page like:
>
> <f:form>
>   <t:panelGrid>
>     <t:panelGroup>
>       <t:inputText required="true"><f:validateLength minimum="15"
> maximum="30"/></t:inputText>
>     </t:panelGroup>
>     <t:panelGroup>
>       <s:subForm id="clickMeForm">
>         <t:commandLink value="clickMe" />
>       </s:subForm>
>     </t:panelGroup>
>   </t:panelGrid>
> </f:form>
>
> When I click the command link, I get validation errors from the input
> text outside of the subform. Correct me if I am wrong, but I thought
> the whole point of the subform was to stop validation and updating
> outside of that component.
>
> What am I doing wrong?
>
> Tomahawk 1.1.2
> Sandbox snapshot 2006-05-13
>
> Thanks,
> Andrew
>