This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spend a fixed value of the inputText to ManagedBean