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
BrabasBrabas 

Problem with dynamic Component and id's

Greetings

 

I have a problem with Dynamic Components, How I can generate id's for Component.Apex.commandButton contained in Component.Apex.column?

 
 Component.Apex.pageBlockTable tblContacs= new Component.Apex.pageBlockTable();
        tblContacs.value=topContacs;
        tblContacs.var='itemC'; 
        tblContacs.columns=5;
        
        tblContacs.id='tblContact'; 
       
        tblContacs.title='Contacts';
        tblContacs.Style='width:680px'; 

 

public void  getpageColumnBtnUpdate(Component.Apex.pageBlockTable vTable , String tipeTable){


 Component.Apex.column save= new Component.Apex.column();
        
        save.title='update';
        save.width='60px';                    
           
          
Component.Apex.commandButton btnSave= new Component.Apex.commandButton ();
   
                
       string S=btnSave.expressions.value='{!itemC.Id}' ;   
      
       //btnSave.id= ' '; here must be the ID of the contact
        
        btnSave.action="{!quickSave}";
        btnSave.expressions.title=S;       
        btnSave.style='display:none;';
    
 

  save.childComponents.add(btnSave);
  
    
vTable.childComponents.add(save);
 

}

 Thanks,