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
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.
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.
So if you are not going to use the JSF event for it, don't use the ValueChangeEvent object.