aspose file tools*
The moose likes JSF and the fly likes cant get value from inputText Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "cant get value from inputText" Watch "cant get value from inputText" New topic
Author

cant get value from inputText

lynn fann
Ranch Hand

Joined: Oct 15, 2006
Posts: 115
Im trying to get the value from the inputText by using dateInputTxt.getValue, but it return me null value.
i have the following code in jsf:
<h:inputText value="myBean.dateS" id="sdate" binding="myBean.dateInputTxt">

managed bean:
private HtmlInputText dateInputTxt;

dateInputTxt.getValue(). //this return me a null value.


i have tried with hidden text field, and Im able to get the value by using dateInputTxt.getValue().

Why is it that the method .getValue works for hidden field and not text field?

-thanks.


Luis Soares
Greenhorn

Joined: May 08, 2009
Posts: 3
Hi !

You would have intention of use an expression, but not do it properly. To use expression you must declare it using the format like this : #{expression}.
For example :



Otherwise you can try to set a simple value to component and try get your value.




Best regards,

Mr. Soares
Java Programmer
São Paulo - Brazil
lynn fann
Ranch Hand

Joined: Oct 15, 2006
Posts: 115
oopz. my bad. some typo here. i did have the #{} for the value and binding.
Luis Soares
Greenhorn

Joined: May 08, 2009
Posts: 3
But how is your implementation of method "getDateS()"
in your "myBean" managed bean ? The result of this method that is assigned to property "value" of this component.
lynn fann
Ranch Hand

Joined: Oct 15, 2006
Posts: 115
im my managed bean, i only generate the getter and setter method. (the default as what most IDE will auto generate)

do i have to add in any codes?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cant get value from inputText