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
S SaiS Sai 

Create edit and delete command link in visualforce page ?

hi 

PAGE
-------------
<apex:page controller="css" showHeader="false" applyBodyTag="false" docType="html-5.0" sidebar="false" standardStylesheets="false" >
        <apex:form >
                <b> Select Account Name : </b>
                <apex:selectList value="{!selectedaccid}" size="1" style="margin: 45px 25px 0;width: 200px;" styleClass="easyui-combobox"> 
                <apex:selectOptions value="{!AccountNames}"/>
                </apex:selectList>
               <apex:commandButton value="ShowContacts"  rerender="out" /><br/>
                <apex:actionSupport event="onchange" reRender="a" />
       <apex:outputPanel id="out"> 
        <table width="100%" border = "1" bordercolor="#DCE1E6"  cellpadding="5" cellspacing="0">
            <tr align="center">
                    <th scope="col" align="center" bgcolor = "#FFBBFF" >Name</th>
            <th scope="col" align="center" bgcolor = "#FFBBFF">Email</th>
             </tr> 
             <apex:repeat value="{!ContactList}" var="con">
                <tr>
                    <td align="center" style="color:black;">{!con.name}</td>
                                <td align="center" style="color:black;">{!con.email}</td>
                    
                </tr>  
            
            </apex:repeat>
            </table>      
        </apex:outputPanel>  
     </apex:form>
        </apex:page>

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

public class css{

    public String getContact() {
        return null;
    }


    public String us { get; set; }
        
        public String selectedAccId{get;set;}
        public integer consize {get;set;}
        
            
        

        public List<SelectOption> getaccountNames() {
        List<SelectOption> acccOptions= new List<SelectOption>();
        acccOptions.add( new SelectOption('','--Select--'));
        list<account> acc= [select Id,name from account];
        for( account  ac: acc) {
        acccOptions.add( new SelectOption(ac.Id,ac.name));
        }
        return acccOptions;
        }
    
        
               
        
        Public List<contact> getContactList(){
        List<Contact> conlist=[SELECT ID,name, Firstname,lastname,email,phone,accountId from contact WHERE accountId=:selectedaccid];
        
        consize =conlist.size();
       if(conlist.size() >0){
                return conlist;
          }else{
          return null;
         }    
                }
        }


here i want to create in contact table create edit delete command link when i am click the delete command link then show popup  window 

thanks 
SS
SonamSonam (Salesforce Developers) 
Can you please explain what is the issue you are facing with this code? Are the links not working?
S SaiS Sai
Hi Sonam,

Thanks for reply in this code i want to create edit and update command link. when i am clicking edit command link in that time show update command link when iam update the row in that time show edit command link

Thanks,
SS