You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Martin Denham <mj...@gmail.com> on 2006/05/13 14:12:50 UTC

How many forms?

What is the standard approach to the use of forms in JSF?

I recentlly tried to add a commandLink to my left menu bar but it did
not work because it was not in a form.  To make my commandLink work I
wrapped the left menu inside another form.  However, I notice in the
SRDemo application the whole of every page is wrapped in a single
form.

Is there a recommended approach to the use of forms?  Are there any
problems in having many forms?

Thanks

Martin

Re: How many forms?

Posted by Martin Marinschek <ma...@gmail.com>.
Gerald is of course right, but -

In general, you can run into problems using multiple forms with JSF.

It's much simpler to just have one form around everything - and then use the

<s:subForm/>

tag to partially process only part of the page.

regards,

Martin

On 5/13/06, Gerald Müllan <bi...@gmail.com> wrote:
> Hi Martin,
>
> think its not bad practice if separating the page in some forms.
>
> It`s not every time a need to submit the whole page. For example, if
> you have a left bar, where you do the login procedure, you can also
> embed only the submit button and the input fields in one form. The
> content area in another one.
>
> Just think in terms of which stuff belongs together and should be
> plugged into one block.
> This should be a good starting point to embed it into a form.
>
> Hope that helps,
>
> cheers,
>
> Gerald
>
> On 5/13/06, Martin Denham <mj...@gmail.com> wrote:
> > What is the standard approach to the use of forms in JSF?
> >
> > I recentlly tried to add a commandLink to my left menu bar but it did
> > not work because it was not in a form.  To make my commandLink work I
> > wrapped the left menu inside another form.  However, I notice in the
> > SRDemo application the whole of every page is wrapped in a single
> > form.
> >
> > Is there a recommended approach to the use of forms?  Are there any
> > problems in having many forms?
> >
> > Thanks
> >
> > Martin
> >
>
>
> --
> Gerald Müllan
> Schelleingasse 2/11
> 1040 Vienna, Austria
> 0043 699 11772506
> Bierbrauen@gmail.com
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: How many forms?

Posted by Gerald Müllan <bi...@gmail.com>.
Hi Martin,

think its not bad practice if separating the page in some forms.

It`s not every time a need to submit the whole page. For example, if
you have a left bar, where you do the login procedure, you can also
embed only the submit button and the input fields in one form. The
content area in another one.

Just think in terms of which stuff belongs together and should be
plugged into one block.
This should be a good starting point to embed it into a form.

Hope that helps,

cheers,

Gerald

On 5/13/06, Martin Denham <mj...@gmail.com> wrote:
> What is the standard approach to the use of forms in JSF?
>
> I recentlly tried to add a commandLink to my left menu bar but it did
> not work because it was not in a form.  To make my commandLink work I
> wrapped the left menu inside another form.  However, I notice in the
> SRDemo application the whole of every page is wrapped in a single
> form.
>
> Is there a recommended approach to the use of forms?  Are there any
> problems in having many forms?
>
> Thanks
>
> Martin
>


-- 
Gerald Müllan
Schelleingasse 2/11
1040 Vienna, Austria
0043 699 11772506
Bierbrauen@gmail.com