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

Passing current value to Controller using apex:param
In a pageblock table, I have this column which passes the value entered in the inputField to controller for rerendering
as outputtext. However, the following code is returning the null value in counting field. Can anyone help in this regard.
<apex:column headerValue="Capacity" id="CapacityColumn">
<apex:inputField id="cap" value="{!fest.Capacity__c}" rendered="{!isEditable}" />
<apex:actionSupport event="onclick"
rerender="counting" status="counterStatus">
<apex:param assignTo="{!counting}" value="this.value" />
</apex:actionSupport>
</apex:column>
------ --------
output2: <apex:outputtext id="counting" value="{!Counting}"/>
Controller:
String Counting;
public String getCounting() {
return counting;
}
as outputtext. However, the following code is returning the null value in counting field. Can anyone help in this regard.
<apex:column headerValue="Capacity" id="CapacityColumn">
<apex:inputField id="cap" value="{!fest.Capacity__c}" rendered="{!isEditable}" />
<apex:actionSupport event="onclick"
rerender="counting" status="counterStatus">
<apex:param assignTo="{!counting}" value="this.value" />
</apex:actionSupport>
</apex:column>
------ --------
output2: <apex:outputtext id="counting" value="{!Counting}"/>
Controller:
String Counting;
public String getCounting() {
return counting;
}
This may not be the problem with your code, but I think it would be a good idea to give the outputtext's id as something other than "counting". There seems to be multiple counting in the code. Controller variable, id etc.
Regards,
Lakshmi.
Unfortunately that is not the issue. I have changed the names but it did not work out. It is showing as null in system.debug statements of apex classe.
</apex:column>
<apex:column headerValue="Capacity" id="CapacityColumn">
<apex:inputField id="cap" value="{!fest.Capacity__c}" rendered="{!isEditable}" >
<apex:actionSupport event="onclick"
rerender="text" status="counterStatus">
<apex:param assignTo="{!counting}" value="this.value" />
</apex:actionSupport>
</apex:inputField>
</apex:column
---
output2: <apex:outputtext id="text" value="{!TextValue}"/>
Controller:
String Counting;
public String getTextValue() {
return counting;
}
Define counting as public string counting{get;set;} in your controller and try once again.
Thaks,
Gokul
It did not solve the issue.
Also looks like you have not used the action method in the actionsupport tag.
Regards,
Lakshmi.