wood burning stoves 2.0*
The moose likes JSF and the fly likes ValueChangeListener or ValueChangeEvent question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "ValueChangeListener or ValueChangeEvent question" Watch "ValueChangeListener or ValueChangeEvent question" New topic

ValueChangeListener or ValueChangeEvent question

Davie Lin
Ranch Hand

Joined: Aug 05, 2007
Posts: 294
Hi guys,

I have a question about ValueChangeEvent.

My scenario is quite basic, have a drop-down and when the user pick a choice, it fires up the method. I have my method signature correct.
HOWEVER, I have notice that so far it works for

but when I change it to

and the html render

than the method won't fire at all, my page just refresh
I was wondering does ValueChangeEvent only works with String or are there type that it will work with?

Thanks a bunch

Brendan Healey
Ranch Hand

Joined: May 12, 2009
Posts: 218
I've no idea what you're on about. You want to have intra-page communication
between components? Select country, then get list of states/counties?
Davie Lin
Ranch Hand

Joined: Aug 05, 2007
Posts: 294
Yeah, something like that, but what I am saying is value change event only fires if I use String in select item's value, doesn't work with primitives. does that make sense?
Brendan Healey
Ranch Hand

Joined: May 12, 2009
Posts: 218
Hi, I think it should work ok using the SelectItem(1, "string"), the problem I've had is with
putting these in an SelectItem array, you seem to need to use a collection. Could it be that the
VCL isn't firing because the component is invalid (probably due to a bug)?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960

ValueChangedEvents work just fine with non-string values. However, you can have problems if the target property doesn't have get/set methods for long values.

Customer surveys are for companies who didn't pay proper attention to begin with.
subject: ValueChangeListener or ValueChangeEvent question
Similar Threads
Create a Different selectOneListbox Depending On the Radio Button Clicked
Bean Value is always Null
Help - question on selectOneListbox and page reloads
Linking selectItem in loop with list not from backing bean
SelectItem Help needed