+ Start a Discussion

Apex:Param not working in outputLink

Hi ,


I need to pass a value when i am clicking the output link . I am using the following the code .It is not working .


<apex:outputPanel rendered="{!results1.size !=0 }">

  <div class="mapResults">
           <div class="sort">

 <div id="hideMap1" style="display:none">
                 <apex:outputLink id="map2" value="javascript&colon;hidemap();" styleClass="hideMapLink">
                 <apex:param name="a1" value="true" assignTo="{!displayAccImage}" />

<div id="showMap1" >
                         <apex:outputLink id="map1" value="javascript&colon;showmap();resizeMap();" styleClass="showMapLink">
                      <apex:param name="a2" value="true" assignTo="{!displayAccImage}" />

<div id="mapContainer" class="mapclass" style="display:none">
            <div id="map" >

<div >
         <div id="hideMap2" style="display:none">
                        <apex:outputLink value="javascript&colon;hidemap();" styleClass="hideMapTab">{!$Label.Hide_Map}
                                     <apex:param id="zyx" name="a3" value="false" assignTo="{!displayAccImage}" />
         <div id="showMap2" >
                       <apex:outputLink value="javascript&colon;showmap();resizeMap();" styleClass="showMapTab">                                                   { ! $Label.Show_Map}
                       <apex:param id="xyz" name="a4" value="true" assignTo="{!displayAccImage}" />


My task is when i click the showmap link the value for displaAccImage set to true . when i click the hidemap link the value should be false . i want to acheive this with outputlink i dont want commandlink ..etc . All javascript methods are properly called .


Please help me how to acheive this .


Many Thanks in Advance



I don't think you can use the assignto that way when the param is a child of outputlink.  In that case its used as a replacement for an item in the link detail.  if you want to update properties in the controller, you'll need to use a commandlink.

Vishal GuptaVishal Gupta
Hi Prakash ,

Bob is right.u need to use command link if u wana pass the value to controller.

<apex:commandLink value="Remove" style="color:red" action="{!remove}" reRender="recTable">
<apex:param name="param" value="{!rec.rowNumber}" assignTo="{!rowNo}"/>

here is a piece of code from my project where i have used a same logic.

Mark it as a solution if u want.