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
Ugesh.galiUgesh.gali 

how to generate param values in a repeater

 

Apex page code  
<apex:repeat>
<apex:commandButton value="Delete" action="{!DelAlert}" id="delButton" onclick="return confirm('Are you sure {!ActiveAlerts.Id}');">
                            <apex:param name="dParam" value="{!ActiveAlerts.id}" assignTo="{!dParam}" />
                           </apex:commandButton>  
 </apex:repeat>

 

apex class
public string dParam{get;set{
dParam = value;
System.debug('value: '+value);
}}

 

 

Ritesh AswaneyRitesh Aswaney

You'd iterate over a collection potentially - for starters your controller method would return a list of values rather than just a singular value.The assignTo should work with a single variable as you can only potentially delete one record at a time ?

 

<apex:repeat value="{!ControllerCollection}" var="paramVar">
<apex:commandButton value="Delete" action="{!DelAlert}" id="delButton" onclick="return confirm('Are you sure {!ActiveAlerts.Id}');">
                            <apex:param name="dParam" value="{!paramVar.id}" assignTo="{!dParam}" />
                           </apex:commandButton>  
 </apex:repeat>