• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Updating Backing Bean Properties using commandLink

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone,

Can any one tell me how to update the backing bean proprties from the JSF as soon as the user clicks my command link button?



The problem I have is that the page has another form which also maintains (viewBookingBean.fromRange and viewBookingBean.toRange) and this can override the backing bean properties in the above form.

Also the validation is triggered first, so what I need is

1) Once user clicks "Download data as CSV"
2) JSF Updates the backing bean (fromRange and toRange) with values on the form
3) Performs the validaiton

I would really appreciate it if someone could advise me on how to do this?

 
Saloon Keeper
Posts: 24283
167
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
I'm afraid that all that AJAX and URL parameters has kind of muddied things for me, but going back to the basic rules of JSF:

When you click a (non-AJAX) commandLink, all of the input controls of the form containing that link are marshalled and sent to the server.

In JSF, you do not update the properties and then validate. In JSF, validation occurs first. One of JSF's primary characteristics is that when an action fires, ALL of the submitted properties are already guaranteed valid and posted to the backing bean(s). If even one validation fails, the backing bean will not be updated and the action method will not fire.
 
reply
    Bookmark Topic Watch Topic
  • New Topic