• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

cant get value from inputText

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.


 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.



 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oopz. my bad. some typo here. i did have the #{} for the value and binding.
 
Luis Soares
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
reply
    Bookmark Topic Watch Topic
  • New Topic