wood burning stoves 2.0*
The moose likes JSF and the fly likes setValueChangeListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "setValueChangeListener" Watch "setValueChangeListener" New topic
Author

setValueChangeListener

Natt Gonzalez
Ranch Hand

Joined: Apr 28, 2008
Posts: 31
Hello! I have a problem.I add a ValueChangeListener but it is not invoked.
I have my custom tag and its has some componnents. One of them is a HtmlSelectOneMenu element. In the encodeBegin method of my tag i create the HtmlSelectOneMenu and I write:


My tag extends UIInput to implements the EditableValueHolder interface. I have been reading that the valuechange listener is called in the validation method of the JSF lifecycle.
In my bean I have
Also in the tag I have the following code to invoke the validation method but my listner is never invoked



Sorry for my English.
Can someone help me?
Thanks
naushad qamar
Greenhorn

Joined: May 31, 2009
Posts: 10
Class[] parms = new Class[] {ValueChangeEvent.class};
MethodBinding mb = FacesContext.getCurrentInstance().getApplication().createMethodBinding("#{myBean.listenerType}", parms);
combo.setValueChangeListener(mb);
combo.setOnchange("submit();");//add this line
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16308
    
  22

You're about 5 years too late, I think.


Customer surveys are for companies who didn't pay proper attention to begin with.
naushad qamar
Greenhorn

Joined: May 31, 2009
Posts: 10
well Tim yes its too:) late but I have face the same issue today and find this question but no answer was there .I just added answer after fixing this issue to help community .
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16308
    
  22

I warn people about playing with the internals of JSF when they do things like this. I don't think that your code would have worked back then, since the EL processor changed quite a bit.

Sometimes stuff like this is necessary, but it's always a good idea to make sure there isn't an XML (VDL) solution first, since the XML doesn't break as easily.
naushad qamar
Greenhorn

Joined: May 31, 2009
Posts: 10
My code will work as it is used in our current projects it is an old application developed using richfaces 1.2 clients are reluctant to upgrade it so there is sevral applications where we can used.as far as playing with internal things of jsf it is because we have dynamic forms so we generate codes for jsf forms.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16308
    
  22

You've got a bigger problem than you realize.

In order to function properly with IE10 and later, you need RichFaces 4. Red Hat Jboss has explicitly stated that RF 3 and earlier will never support it.

There are serious JavaScript conflicts because (surprise!) Microsoft chose an incompatible way to implement certain core JavaScript functionalities.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setValueChangeListener