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
Jim BoudreauxJim Boudreaux 

Does the 'assignto' attribute of apex:param actually do anything?

ok, as I understand it,
<apex: param assignto="{!resultid}" value="123"/>
should assign the value, in this case "123" to the setter method setResultID() in the controller right?
Well it doesn't.
public string resultid; 
public string getResultId(){ return resultid; } 
public void setResultId(string id){ this.resultid = id; } 

<apex:outputpanel id="result> 
   <apex:actionsupport event="onclick" action="{!myretrieve}" rerender="result" status="status">
     <apex:param assignto="{!resultid}" value="123"/> 
   Click Me 

Shouldn't clicking this outputlabel result in the {!resultid} displaying "123"?
Ron HessRon Hess
Hi Jim
your code is missing a quote after id="result

The code below works fine with no controller at all.

<apex:page >
<apex:outputpanel id="result" >
<apex:actionsupport event="onclick" rerender="result" status="status">
<apex:param assignto="{!resultid}" value="123" />
Click Me

This shows that the controller is not needed, resultid is created for you, and filled in and the result output panel shows the number 123 when i click on the label.

Now when i add a controller:
public class tryparam {
    public string resultId { 
set { resultid = value; system.debug( 'set result id '+resultid); }
} }


it continues to work, and my debug log ( System Log) does show the debug statement with the correct value.

Message Edited by Ron Hess on 01-07-2009 10:39 AM
Can you please provide an example of this working within any type of list?  I've tried dataTable, pageBlockTable, repeat, and dataList.