Forums Register Login

javax.faces.el.MethodNotFoundException in JSF

+Pie Number of slices to send: Send
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

+Pie Number of slices to send: Send
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.

Oh. Hi guys! Look at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 3053 times.
Similar Threads
Null pointer Exception thrown in JadeGatewayServlet
NamingException on call from WPS 6.1 Portlet to Remote EJB 3.0 on separate Machine
BIRT Exception messge when click to view report
Struts File upload problem
Custom Validation Messages - advanced
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 08:14:39.