File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setValueChangeListener

 
Natt Gonzalez
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17624
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're about 5 years too late, I think.
 
naushad qamar
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17624
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17624
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic