You need to sign in to do that
Don't have an account?
Venkatesh
Unable to call a function from apex for inputtext onkeyup
I have a input text field. If user changes the value there something like dialog box to inform that the value has been changed.for this i have used "onkeyup" in the inputtext as shown below
<apex:inputText value="{!Qty}" onkeyup="unitPriceValidation();"/>
and this is the method that am calling .
public void unitPriceValidation(){
System.debug('inside unitPriceValidation');
for(jsonvalue wrapper : ProducList){
String unitQuantity;
String Price;
unitQuantity = wrapper.Qty;
Price = wrapper.UnitPrice;
System.debug('Quanity :' +unitQuantity);
System.debug('Price :' +Price);
}
}
But am unable to see the debug log . I think the function is not calling .
Where is the mistake .
<apex:inputText value="{!Qty}" onkeyup="unitPriceValidation();"/>
and this is the method that am calling .
public void unitPriceValidation(){
System.debug('inside unitPriceValidation');
for(jsonvalue wrapper : ProducList){
String unitQuantity;
String Price;
unitQuantity = wrapper.Qty;
Price = wrapper.UnitPrice;
System.debug('Quanity :' +unitQuantity);
System.debug('Price :' +Price);
}
}
But am unable to see the debug log . I think the function is not calling .
Where is the mistake .
Use action function (https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_actionFunction.htm) to call controller's method from visualforce. You can't directly bind a listener to events to call server side method.
Check out following this link (http://www.infallibletechie.com/2012/10/calling-controller-method-using.html)for example.
Hope this resolves your issue.