Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF pass parameters onclick  RSS feed

 
Himalay Majumdar
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am trying to set a bean value when the button is click, by passing the parameters as setCurrentStatementId(statement.statementId). The parameter statement.statementId is basically intended to call a getter method in statement value object. Can anyone advise me if this is the correct way.



Many thanks.
-Himalay
 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No it isn't. An "action=" attribute isn't a function call or logic expression, it's the specification of the name of an action processor that is to be invoked. The action processor is a public method that take NO arguments and returns a String.

Action processors get their "parameters" from the backing beans. These properties are set as part of the JSF lifecycle when the data that to be set has passed validation. Normally an action is fired as part of a form submit process, so this is the same basic thing as having a form processor get called where the form's fields have been stored into backing beans.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!