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
Sandy singhSandy singh 

Command Link button is not working

Hi All,

 

 Command Link button is not working for me. Below is my code:

VisualForce Code:  
  
<apex:pageblockTable value="{!request}" var="request"  width="100%"   rendered="{!request.size > 0}">
     <apex:column width="20%">
      <apex:facet name="header">Action</apex:facet>
      <apex:commandLink action="{!deleteSelectedRecord}" value="Delete" >
      <apex:param name="selectActionLink" value="{!request.Id}" assignTo="{!selectActionLink}"/>  
      </apex:commandLink>
                   	    
     <apex:outputText value="|" />
     <apex:commandLink action="{!holdRecord}" value="Hold/Release"  reRender="block">
     <apex:param name="selectActionLink" value="{!request.Id}" assignTo="{!selectActionLink}"/>
     <apex:param name="holdReleseFlag" value="True" assignTo="{!holdReleseFlag}"/> 
     </apex:commandLink> 
     </apex:column>
     <apex:column value="{!request.rank__c}"  width="5%" headerValue="Rank"/>
    </apex:pageblockTable>
-----------------------------------------------------------	
	
Controller Code:
 public Pagereference deleteSelectedRecord(){
  PageReference newPage = new PageReference('/apex/PgaeOne');
  newPage.setRedirect(true);
  return newPage;
  }

 Please look this and help me.

 

Thanks in advance.

 

Regards,

Sandy

 

Abhay AroraAbhay Arora

Hi Sandy,

 

There is always a problem with Apex:Param check this as i am sure this value will always be null in controller.

 

Also in your code there is only one apex:column try below code if it helps

 

    <apex:column width="20%">
      <apex:facet name="header">Action</apex:facet>
      <apex:commandLink action="{!deleteSelectedRecord}" value="Delete" >
      <apex:param name="selectActionLink" value="{!request.Id}" assignTo="{!selectActionLink}"/>  
      </apex:commandLink>
    </apex:column>      
    
    
     <apex:outputText value="|" />
     <apex:column width="20%">    
     <apex:commandLink action="{!holdRecord}" value="Hold/Release"  reRender="block">
     <apex:param name="selectActionLink" value="{!request.Id}" assignTo="{!selectActionLink}"/>
     <apex:param name="holdReleseFlag" value="True" assignTo="{!holdReleseFlag}"/>
     </apex:column>
     </apex:column>

 

Hope above helps you