function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Abilash Kosigi 8Abilash Kosigi 8 

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;
    }
lakslaks
Hi Abhilash,

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.
Abilash Kosigi 8Abilash Kosigi 8
Hi 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;
    }


 
Abilash Kosigi 8Abilash Kosigi 8
Can anyone please help with respect to this question.
gokul bharatigokul bharati
Hi Abhilash,

Define counting as public string counting{get;set;} in your controller and try once again.

Thaks,
Gokul
Abilash Kosigi 8Abilash Kosigi 8
Hi Gokul,
It did not solve the issue.

 
lakslaks
Maybe you can try using event="onchange"
Also looks like you have not used the action method in the actionsupport tag.

Regards,
Lakshmi.