• Post Reply Bookmark Topic Watch Topic
  • New Topic

javax.faces.el.MethodNotFoundException in JSF  RSS feed

Padma Priya
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have 2 text fields and one select drop down. The logic is that if i change the value in one text box the value in the other text box needs to be changed automatically based on a logic implemented in a method in the controller and vice versa.

Code for Percentage text field

Code for Amount text field

Code for the dropdown

So for all three of the above fields. When some actions are carried on these fields like changing the value in the text boxes and selecting a value from the drop down the onchange calls the submitOnXXXChange() javascript methods.

There are Fake buttons coded which in turn call the methods that are coded in the controller. These methods hold the logic for what ever needs to be done when the values in the 2 text fields and the value in the dropdown changes.

On Amount change

On Percentage change

On Status Change


The problem i am facing is when i change the percentage /Amount fileds everything is working fine. The appropriate onSettelmentAmtChange() and
onSettelmentPercentageChange() methods in the controller are called properly. But when i try to select a list from the drop down i get the below error.

Can anyone help me out in figuring why this happening. I know its not the best coding practice but the code was put as a workaround or something and nobody wants to touch it.

Thanks in advance for your help.

With Regards,
Padma Priya

Stefan Evans
Posts: 1836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well lets take a look at what is different between these methods shall we?

public void onSettelmentAmtChange() throws AbortProcessingException {
public void onSettelmentPercentageChange() throws AbortProcessingException {
public void onSettelmentStatusChange(ValueChangeEvent event)

Hmmm. Thats different.
Your statusChange method takes a ValueChangeEvent parameter, where your other ones don't...
And the error message complains:
Cannot find method: com.wellsfargo.yom.account.controller.RecoveryController.onSettelmentStatusChange()
Well thats true, because a method which takes no parameters isn't there.

So why does this one take a parameter? What is this parameter meant to do? and where does its value come from?
A quick google later, and an answer is forthcoming.

That method declaring a ValueChangeEvent parameter is meant to be invoked by faces directly using a onValueChange attribute of your dropdown.
You are manually trying to call this method via your onchange javascript event.
So if you are not going to use the JSF event for it, don't use the ValueChangeEvent object.

My suggestion: use JSF as it was meant to be used, with a valueChangeEvent on the selectOneListBox, instead of fudging it with javascript onchange events.

Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!