This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JSF and the fly likes Mutiple form problem in JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "Mutiple form problem in JSF" Watch "Mutiple form problem in JSF" New topic
Author

Mutiple form problem in JSF

A.C Ac
Greenhorn

Joined: Aug 09, 2012
Posts: 2
I have an xhtml page with two forms.In form1 I have one input text and in form two I have a submit button.In the actionlistener of the action button in form2 I want to get the value of the fom1's input textbox throgh the backing bean value.When I am trying it is giving null value.What is the workaround of this problem?
Brendan Healey
Ranch Hand

Joined: May 12, 2009
Posts: 218
The obvious thing to do is to use one form. Why have you got two? This is the source of all your problems. The submit button
is submitting the values of components within the form it is in, which sounds like just the button. These values (ok, this value)
is sent to the server, but not the input field value.

There's rarely any reason to use multiple forms in an ajax world except in a few exceptional situations such as when doing
file upload and using dialogs. You just limit what gets sent to the server with f:ajax execute=, and you save yourself getting
confused about which naming container your components are in.

My understanding is that what you are trying to do is completely impossible with HTML & JSF.

Regards,
Brendan.
A.C Ac
Greenhorn

Joined: Aug 09, 2012
Posts: 2
I know it is not a good practice to have multiple forms in one single page.But I want it to achieve the following template

header
content
left content right content
footer

Now in the actual page where I am using this template, I want to put my buttons in the left area and other inputs in the right area.On the click of the button on the left form should submit the values entered in the right form.
Please let me nkow how to achieve this.
 
GeeCON Prague 2014
 
subject: Mutiple form problem in JSF