aspose file tools*
The moose likes JSF and the fly likes Spend a fixed value of the inputText to ManagedBean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Spend a fixed value of the inputText to ManagedBean" Watch "Spend a fixed value of the inputText to ManagedBean" New topic
Author

Spend a fixed value of the inputText to ManagedBean

Flavio Mendes Santana
Greenhorn

Joined: Apr 21, 2013
Posts: 2
Goodnight everyone.

I wonder how do I pass a default parameter for ManagedBean through a JSF inputText component. I want for example, every time I register a branch of a company, this field shows always the value "1" and pass this value to the form ManagedBean (and then record in the database).

My component is currently as follows:



Where I declare this fixed value (1) in my code?

Thank you!
Avik Mazunder
Ranch Hand

Joined: Jun 27, 2012
Posts: 39

you can set the value using setter at the default constructor of the bean
Flavio Mendes Santana
Greenhorn

Joined: Apr 21, 2013
Posts: 2
Thank you very much dear friend. This solved my problem.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Spend a fixed value of the inputText to ManagedBean