+ Start a Discussion
Prakash@SFDCPrakash@SFDC 

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">
                <span>{!$Label.Results}</span>

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

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

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

<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}" />
                        </apex:outputLink>
          </div>
         <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}" />
           </apex:outputLink>
     </div>
 </div>
</div>
</apex:outputPanel>

 

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

Prakash.N

bob_buzzardbob_buzzard

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}"/>
</apex:commandLink>

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



Mark it as a solution if u want.