+ Start a Discussion
pupilstuffpupilstuff 

Editing rows in pageblock table

public class DataMapperControllerTestMay {
   
    public boolean saveFlag {get;set;}
    public boolean cancelFlag {get;set;}
   
    // Describe
    public Map  <String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
    public List <SelectOption> objectNamesList{public get; private set;}
    public String selectedObjectStr {get; set;}
   
    public List <SelectOption> fieldNamesList {get; set;}
    public String selectedFieldStr {get; set;}
   
    // Describe
   
    public PageReference cancelActivity() {
        return null;
    }


    public PageReference saveActivity() {
       
        String targetStr = selectedObjectStr +':'+ selectedFieldStr ;
        System.debug('@@targetStr '+targetStr);

        System.debug('@@GE_B2B_WSDL_Definition__c.getAll()'+GE_B2B_WSDL_Definition__c.getAll());
        B2BFieldMapperManager.addUpdate(Mappings[0].Source_Name__c ,targetStr);
        return null;
    }


    public PageReference editActivity() {
        saveFlag = true;
        cancelFlag = true;
        return null;
    }
       
    public DataMapperControllerTestMay(){
       
        //Describer
        objectNamesList = initObjNames();
        fieldNamesList = new List<SelectOption>();

        //Describer

       Mappings=loadMappings();
    }

    public List<GE_B2B_Field_Mapper__c> Mappings {get;set;}
    public List<GE_B2B_Field_Mapper__c> Vals;
            
    public List<GE_B2B_Field_Mapper__c> loadMappings() {
        Vals = [Select Source_Name__c, Target_Attribute__c, Target_Object__c from GE_B2B_Field_Mapper__c];
        return Vals;
    }
  
   // Describer
  
    private List<SelectOption> initObjNames() {
        List<SelectOption> objNamesList = new List<SelectOption>();
        List<String> entitiesList = new List<String>(schemaMap.keySet());
        entitiesList.sort();
        for(String nameStr : entitiesList)
            objNamesList.add(new SelectOption(nameStr,nameStr));
            return objNamesList;
    }
   
    public pageReference initFieldNamesRef(){
      initFieldNames();
      return null;
    }
   
    public List<SelectOption> initFieldNames() {
        Map <String, Schema.SObjectField> fieldMap = schemaMap.get(selectedObjectStr).getDescribe().fields.getMap();
        fieldNamesList.clear();
        for(String nameFieldStr : fieldMap.keyset()){
            fieldNamesList.add(new SelectOption(nameFieldStr ,nameFieldStr));
        }
            return fieldNamesList;
    }
   
  
  
  
   // Describer
 
}

SFFSFF

I think points 7, 8, 10, 11, 13, and 14 apply here:

 

http://www.salesforcefast.com/2012/10/using-sfdc-messageboards-primer.html