You need to sign in to do that
Don't have an account?
VSK98
Passing the value from vfpage to controller using inputtext but getting null
Hi All,
I have build sample vf page passing the values from vf page to controller using inputtext........But i am getting null value
Here is my code:
Controller:
Pls give suggwestions.............
Adv Thnx
VSK98
I have build sample vf page passing the values from vf page to controller using inputtext........But i am getting null value
Here is my code:
<apex:page controller="Displayoutput"> <script type="text/javascript"> function DisplayErr(){ if(document.getElementById('{!$Component.frm.Num}').value == ''){ alert("Please fill the Number"); } else{ callDisplay(); alert("Perfect"); } } </script> <apex:form id="frm"> <apex:actionFunction action="{!Display}" name="callDisplay"/> <apex:outputText value="Enter The Number"/> <apex:inputText id="Num" value="{!text}"/> <apex:commandButton value="Validate" onclick="DisplayErr()" /> Sample Output: </apex:form> </apex:page>
Controller:
Public class Displayoutput{ public string dis{get;set;} public string text{get;set;} public String gettext(){ return text; } public Displayoutput(){ system.debug('Enter in Constructor*****'); system.debug('TEXTVALUE*****'+text); } public void Display(){ system.debug('TEXTVALUE*****'+text); } }
Pls give suggwestions.............
Adv Thnx
VSK98
Whenever you are calling an action function you have to reRender any tag. Use the below action funtion. You will get the Name getting displayed in the log.
<apex:actionFunction action="{!Display}" name="callDisplay" reRender="frm"/>
Thanks
Manoj S
Try this and let me know if it works.