• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

automatic form submission

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can a form have a backing bean action method as an action, eg

So that I can submit the form automatically.. eg


or how else do I submit a form without user intervention?
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No. The form tag will ultimately get translated into an HTTP POST request routed to the JSF dispatcher servlet. And, of course, when you do HTTP POST, the entire form's data gets sent, not just a single item.

However check the JSF button tag docs. I'm pretty certain that I have done forms with multiple buttons where I did actions based on which button was clicked.
 
Mike Halford
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. I don't want a button though. I want to submit the form automatically.
 
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you against creating a button or you dont want to show the button on the page ? if case 2, create a button and make it invisible and use javascript to invoke button click action. hope it helps !

Thanks,
 
Mike Halford
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I was going to go for the 'invisible button' option. The page with the form on is only transitory, the user only sees the page fleetingly unless the network is on a go slow. It just says 'Loading...' and then posts the request on automatically. I want it to be transparent, the user shouldn't have to do anything. The page is only there really because I can't get the initial POST request to populate a managed-bean with session scope, see my other question near by . So, as a workaround I'm putting the data into a request-scoped bean first and then copying that data into the session-scope
 
reply
    Bookmark Topic Watch Topic
  • New Topic