• Pankaj Kumar 456
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
My Vf Page is 
<apex:page standardController="Class__c" extensions="ManageClassController" >
    <apex:pageBlock > 
        <apex:pageBlockSection >
            <apex:form >
                <apex:pageBlockTable value="{!classList}" var="c" >
                    <apex:column headerValue="class name">
                        <apex:outputText value="{!c.name}"></apex:outputText>
                    </apex:column>
                    <apex:column headerValue="Edit" >
                        <apex:commandLink value="Edit" action="{!editDetails}">
                            <apex:param assignTo="{!classId}" value="{!c.id}" />
                        </apex:commandLink>
                    </apex:column>    
                    <apex:column headerValue="Delete">
                        <apex:commandLink value="Delete">
                            <apex:param assignTo="{!classId}" value="{!c.id}" />
                        </apex:commandLink>
                    </apex:column>   
                </apex:pageBlockTable>
            </apex:form>
        </apex:pageBlockSection>
        <apex:pageBlockSection >
            
            <apex:form rendered="{!flag}">
                <apex:inputField value="{!dummyClass.name}"/>
                <apex:inputField value="{!dummyClass.Fee__c}"/>
                <apex:inputField value="{!dummyClass.Detailed_Description__c}"/>
                <apex:inputField value="{!dummyClass.Max_Size__c}"/>
                <apex:inputField value="{!dummyClass.My_Count__c}"/>
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandLink value=""/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:form>
            
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>

My Controller is 
public class ManageClassController {
    public List<Class__c> classList{get;set;}
    public String classId{get;set;}
    public class__c dummyClass{get;set;}
    public boolean flag {get;set;}
    private ApexPages.StandardController controller {get; set;}
    public ManageClassController(ApexPages.StandardController stdController){
        this.controller = stdController;
        this.classList = new List<Class__c>([SELECT id , name from class__c]);
        this.flag=false;
        this.classId = null;
    }
    public void editDetails(){
        System.debug('I came here');
        System.debug('classId = ' + this.classID);
        if(this.classId != null){
            this.dummyClass = [SELECT id , name , fee__c , detailed_description__c , max_size__c , my_count__c FROM class__c where id = :classId];
            this.classId = null;
            this.flag = true;
        }
    }
}

My vf page is running as 
User-added imageand as soon as i press edit link value must get populate in controller but is not going
Debug only logs -
User-added imageThanks in advance
My Vf Page is 
<apex:page standardController="Class__c" extensions="ManageClassController" >
    <apex:pageBlock > 
        <apex:pageBlockSection >
            <apex:form >
                <apex:pageBlockTable value="{!classList}" var="c" >
                    <apex:column headerValue="class name">
                        <apex:outputText value="{!c.name}"></apex:outputText>
                    </apex:column>
                    <apex:column headerValue="Edit" >
                        <apex:commandLink value="Edit" action="{!editDetails}">
                            <apex:param assignTo="{!classId}" value="{!c.id}" />
                        </apex:commandLink>
                    </apex:column>    
                    <apex:column headerValue="Delete">
                        <apex:commandLink value="Delete">
                            <apex:param assignTo="{!classId}" value="{!c.id}" />
                        </apex:commandLink>
                    </apex:column>   
                </apex:pageBlockTable>
            </apex:form>
        </apex:pageBlockSection>
        <apex:pageBlockSection >
            
            <apex:form rendered="{!flag}">
                <apex:inputField value="{!dummyClass.name}"/>
                <apex:inputField value="{!dummyClass.Fee__c}"/>
                <apex:inputField value="{!dummyClass.Detailed_Description__c}"/>
                <apex:inputField value="{!dummyClass.Max_Size__c}"/>
                <apex:inputField value="{!dummyClass.My_Count__c}"/>
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandLink value=""/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:form>
            
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>

My Controller is 
public class ManageClassController {
    public List<Class__c> classList{get;set;}
    public String classId{get;set;}
    public class__c dummyClass{get;set;}
    public boolean flag {get;set;}
    private ApexPages.StandardController controller {get; set;}
    public ManageClassController(ApexPages.StandardController stdController){
        this.controller = stdController;
        this.classList = new List<Class__c>([SELECT id , name from class__c]);
        this.flag=false;
        this.classId = null;
    }
    public void editDetails(){
        System.debug('I came here');
        System.debug('classId = ' + this.classID);
        if(this.classId != null){
            this.dummyClass = [SELECT id , name , fee__c , detailed_description__c , max_size__c , my_count__c FROM class__c where id = :classId];
            this.classId = null;
            this.flag = true;
        }
    }
}

My vf page is running as 
User-added imageand as soon as i press edit link value must get populate in controller but is not going
Debug only logs -
User-added imageThanks in advance