aspose file tools*
The moose likes JSF and the fly likes JSF valuechangeListener not detecting a change for values entered manually in a text field. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF valuechangeListener not detecting a change for values entered manually in a text field." Watch "JSF valuechangeListener not detecting a change for values entered manually in a text field." New topic
Author

JSF valuechangeListener not detecting a change for values entered manually in a text field.

Padma Priya
Ranch Hand

Joined: Feb 01, 2007
Posts: 113
Hi all,

I have a specific scenerio

I have a form which has 2 text fileds.

One text field is actually a date field which has a date picker component. So either we can use the date picker to pick the date or enter the date manually. Based on the date that is being selected the other textfield is either enabled or disabled.

So in this scenerio the other text field should be enabled for the date i enter in the date field either manually or through the date picker component.

But when i select the date through the date picker the other text field is enabled but not when i try to add the date manually. But this should be not the case. The other text fild should be enable should be enabled irrespective of wether we select it through the date picker or enter manually.

Does anyone tell me how to do this.

For the date text field below is the code




the value change listener is as shown below





Thanks in advance for your help

With Regards
Chakravarthy
Brendan Healey
Ranch Hand

Joined: May 12, 2009
Posts: 218
Strange - you have <hx:inputHelperDatePicker></hx:inputHelperDatePicker> as a child
component of h:inputText. So hx:inputHelperDatePicker is a composite component you or
one of your colleagues has written to call some JS or jQuery function, yes?

Put the h:inputText inside the composite component, you'll need to use f:convertDateTime
as a child of the inputText component. The composite needs a <composite:attribute name
="value" type="java.util.Date"> attribute.

So your composite component isn't just a helper any more, it's a bona fides date input
component.

The main thing I notice is this old fashioned full page submit stuff you're doing. In all
fairness though I'm still working on putting together an input date/time composite that
is ajax enabled.

I know how to do ajax enabled composite components well enough but haven't figured
out if/how I can get a standard inputText component to generate a 'simulated' js event.

Regards,
Brendan.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF valuechangeListener not detecting a change for values entered manually in a text field.