• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

Mutiple form problem in JSF

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic