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?
Joined: May 12, 2009
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.
Joined: Aug 09, 2012
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
left content right content
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.