Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting Values for Bean Properties

 
Steve Dyke
Ranch Hand
Posts: 1616
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Surly I am not understanding the use of managed bean properties from my JSF. As it stands right now I have to have a physical control on the JSF with the value set to the managed bean property so when a submit is done the value of the input control drives the bean property value.

I have also noticed that the input controls have to be in a certian order for the submit to work. Seems that at least the last setter property has to match the last input control managed bean.

Is there a way to do this with out having the input control on the form?

Example: I have a bean that does remote updates to a particular record in a database. This update is indexed on a recseq number. To make this work from the JSF the recseq has to be a managed bean. However, I really don't want to have to display the recseq on the user form.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Usually Ids are passed as request parameters. But you still need the UIComponents on the JSF page to have a value="#{}" to a property in a managed bean if you the managed bean to have the values that were entered on the page's form.

Mark
 
Steve Dyke
Ranch Hand
Posts: 1616
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if just need the managed bean to have a pre-determined value? Say a session attribute value. Can I set the bean property with JavaScript when I load the JSF?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic