• 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

JSF Newbie: sending params to data provider from text field

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have worked this tutorial on populating a data table with a drop down. I understand how the processValueChange method for a drop down works. It takes the selected value (an id) associated with the display String (a name) and sets the id as a parameter for the data provider: then refreshes the data provider like so



So when you select a person from the dropdown, the table is populated with their info.

I want to do the same thing - but instead of using a dropdown, I want to use a text field and a button. I've tried creating the nameField_processValueChange but I can't seem to set the parameter for the data provider. I keep getting sql errors when I try to refresh because I'm not getting the value to pass in as the parameter.

Does the button change things? What methods to I need to override? Should my parameter changing code go on the button? or the text field? or the form?

Can someone please provide a little direction?
 
chris gar
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ahh! I figured it out.

The text field can be treated the same as the drop down. The textField_processValueChange needs an implementation. My problem was: I was trying to pass an int. I needed to pass a Long.
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Umm, you do know that the Value Change event contains the "before" and "after" values, don't you? You don't need to go digging for the new value.
reply
    Bookmark Topic Watch Topic
  • New Topic