+ Start a Discussion
Balakumar Ramachandran 6Balakumar Ramachandran 6 

Pagereference for <apex:param> not passed

i have a Del button in page and when i click on Del the pagereference section delCont is not called..instead it is getUserName method and closing after that..kindly suggest

page
-------

<apex:commandlink value="Del" action="{!delCont}" id="all">
                       <apex:param name="contIdParam" value="{!user.UserOrGroupId}" assignTo="{!contIdChosen}"/>                  
                     </apex:commandlink>

Controller
--------------

public class WV_ManualShareRead {
  
   public List<Scheme__Share> users;
   public List<User> userName;
   public list<id> useridlist{get;set;}  
  
 
  
   public String contIdChosen {get; set;}

   public WV_ManualShareRead()
   {
    useridList = new list<id>(); 
         
   }
   
   
    public List<Scheme__Share> getUsers()
    {       
        if(users == null)
        {
            users= [select UserOrGroupId from Scheme__Share where ParentId= :ApexPages.currentPage().getParameters().get('parentId')];
            system.debug('----------------My ID is------------------'+users);            
          
            // return users;
            for(Scheme__Share  X:users ){
            id value=X.UserOrGroupId;
             useridlist.add(value);          
            }
           
            return users;                      
         }
         return null;   
    }
   
    public List<User> getUserName()
    {
   
      if(useridlist != null && useridlist.size() > 0)
           {               
               userName = [SELECT Name FROM user WHERE id in :useridlist];
               system.debug('--------------Name is---------------'+userName);
               return userName;
               }
           
        return null;
    }
  
  
    public PageReference delCont()
    {
  
     system.debug('----------------------------------------Test Me------------------------------');
     Id id = System.currentPageReference().getParameters().get('parentId');
     Scheme__Share toDel=new Scheme__Share(id=contIdChosen );
     system.debug('----------Id is------------'+contIdChosen );
     //delete todel;
     //setupContacts();  
     PageReference nextpage1 = new PageReference('/apex/share/WV_SharingDetails?parentId='+id);
     return nextpage1;
    }
   
  
  
   
   
}
SaketJoshiSaketJoshi
Try doing this:
<apex:commandlink value="Del" action="{!delCont}" id="all" rerender="">
    <apex:param name="contIdParam" value="{!user.UserOrGroupId}" assignTo="{!contIdChosen}"/>                  
</apex:commandlink>

Balakumar Ramachandran 6Balakumar Ramachandran 6
that did not work..

please find my VF Page..parameter is passed inside pageblock section

            <apex:pageBlockSection showHeader="false" collapsible="false" columns="2" id="pageBlockSection">          
           
                 <apex:pageblockTable value="{!users}" var="user" > 
                                                         
                         <apex:column width="20%">
                           <apex:facet name="header">Owner ID</apex:facet>  
                          
                             <apex:commandlink value="Del" action="{!delCont}" rerender="" >
                               <apex:param name="contIdChosen"  value="{!user.UserOrGroupId}" assignTo="{!contIdChosen}"/>                         
                             </apex:commandlink>                        
                         </apex:column>
                                        
                  </apex:pageblockTable>