You need to sign in to do that
Don't have an account?

controller method calling from actionfunction
HI
I am calling process() method from <actionfunction> tag there no compilation error
but the method unable to invoke.
anybody help me.
thanks in advance
public with sharing class PassParameterActionFunction {
public string name{set;get;}
public string nameval{set;get;}
public void process(){
nameval=name;
}
}
..............................................................
<apex:page controller="PassParameterActionFunction">
<apex:form id="theform">
<apex:outputPanel id="thepanel">
<apex:outputlabel value="{!nameval}"/>
</apex:outputPanel>
entername:<apex:inputtext id="thename"/>
<apex:commandButton onclick="show();" value="show"/>
<apex:actionFunction name="display" action="{!process}" rerender="thepanel">
<apex:param name="first" assignTo="{!name}" value=""/>
</apex:actionfunction>
</apex:form>
<script type="text/javascript">
function show(){
var a=document.getElementById("{!$Component.theform.thename}").value;
display(a)
}
</script>
</apex:page>
linganna we r busy yar......
If this is an exact cut and paste of the code, I'd imagine its because you are invoking a method called dispaly, but your javascript function is named display:
This won't cause any compilation error, as the IDE can't validate javascript.
I replaced with dispaly with display but unable to get output.
hmmmm i know this issues
just give id to actionfuction
try this
<apex:actionFunction name="display" action="{!process}" rerender="thepanel" id = "display">
as bob_buzzard
put u "var a=document.getElementById("{!$Component.theform.thename}").value;"
under try catch
try
{
var a=document.getElementById("{!$Component.theform.thename}").value;
}
catch(ex)
{
alert(ex);
}
I have given id="display" but not unable to get output .and what is the use of id attribute in this situation.
I am getting the input text value in javascript variable but the function not invoking
I understand u r point that ID parameter is of no use in this case but i have face same kind of issues
then i give ID to action function ID to param both then it start working for me
I belive to define the ID parameter in the the attribute
action function & param
wt linga sir inka raleda....