• Vijay Kumar Rebbala 11
  • NEWBIE
  • 80 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 13
    Replies
Hi,
we are implementing session cache for faster reloads. So I have theses following questions.

1.Lets say I have session cached an Account record and the account record is manually updated later by an Agent.
   In this scenario, how does the session cache gets updated.
2.what should be session cached and what should not?

Thanks in Advance,
Vijay
I need to reorder the columns in pageblocktable on VFP. How can I do that.

Thanks,
Vijay
<apex:page Controller="testctrl1">
    <apex:form >
    <apex:actionRegion >
        <apex:inputField value="{!updacc.Name}"/>
        <apex:inputField value="{!updacc.CustomerPriority__c}"/>
    </apex:actionRegion>
            <apex:commandButton action="{!customupdate}" value="Update" immediate="true"/>
    </apex:form>
</apex:page>



public class testctrl1{   
    public Account updacc{get; set;}
    public testctrl1() {
        updacc = [select Id, Name, CustomerPriority__c From Account where id = '001610000047HlW'];
    }
    public void customupdate(){
       update updacc;
    }
}

If the user change the input field value 'CustomerPriority__c' and click on Save. I need to update the record. How can I do that?

Thanks,
Vijay
<apex:pageBlock>
                <apex:pageBlockTable value="{!Questions}" var="ques" id="questable">
                    <apex:column headerValue="Question">
                        <apex:inputText value="{!Questions[ques]}" id="quesid" style="width: 500px;"/>
                    </apex:column>
                    <apex:column headerValue="Language">
                        <apex:OutputText value="{!ques}" id="langid"/>
                    </apex:column>
                </apex:pageBlockTable>
</apex:pageBlock>
My apex code: 
public Map<String,String> Questions {
        get {
            return new Map<String, String> {
                'French' => '', 
                'German' => '', 
                'Italian' => '',
                'Japanese' => '', 
                'Korean' => '', 
                'Portuguese' => '',
                'Russian' => '', 
                'Chinese Simplified' => '', 
                'Spanish' => '',
                'Chinese Traditional' => ''
            };
        }
        set;
}

Problems is, I cannot access the input text from vfp to maps in apex code.
 
Initially I have set all the InputCheckbox values to false. And shown the values on PageblockTable in VFP. When user changes the checkbox values and click submit, I wanted to get all the new Checkbox values. How can i do that.
 
//VFP:

<apex:page controller="Testctrl">
    <apex:form >
    <apex:pageBlock >
        <apex:pageBlockTable value="{!attdmap}" var="attdkey">
        
            <apex:column value="{!attdkey.Name}"/>
            <apex:column>
                <apex:facet name="header">Absent</apex:facet>
                <apex:inputCheckbox label="Absent" value="{!attdmap[attdkey]}" />
            </apex:column>

        </apex:pageBlockTable>
    </apex:pageBlock>
    
    <apex:commandButton action="{!submit}" value="Submit"/>
    </apex:form>
</apex:page>



//CTRL:

public class Testctrl {
    public list<Student__c> acctlist {get;set;}
    public Map<Student__c, Boolean> attdmap{get;set;}
     
    public Testctrl(){
        attdmap = new Map<Student__c, Boolean>();
        acctlist = [SELECT Id, Name FROM Student__c];

        for(Student__c atu23 : acctlist){
        attdmap.put(atu23,False);
        }
       
    }
    public void submit(){
    }

}

 
<apex:page controller="Testctrl">
    <apex:form >
        <apex:repeat value="{!attdmap}" var="attdkey" >
            <apex:OutputText value="{!attdkey}"/>
            <apex:OutputText value="{!attdmap[attdkey]}"/>
       </apex:repeat>
    </apex:form>
</apex:page>



public class Testctrl {
    public list<Student__c> acctlist {get;set;}
    public Map<Student__c, Boolean> attdmap{get;set;}
     
    public Testctrl(){
        Map<Student__c, Boolean> attdmap = new Map<Student__c, Boolean>();
        acctlist = [SELECT Id, Name FROM Student__c];
        for(Student__c atu23 : acctlist){
        attdmap.put(atu23,false);
        }        
    }

}
Multiple records from Student__c are shown on VFP with inputcheckbox. I want to save the input checkbox values and the Student__c Id's in child records.
//VFP:

<apex:page controller="Testctrl">
    <apex:form >
    <apex:repeat value="{!acctlist}" var="accs" >
        <apex:outputText value="{!accs.Name}"></apex:outputText>
        <apex:inputCheckbox value="{!input}" >
        </apex:inputCheckbox><br/>
    </apex:repeat>
    <apex:commandButton action="{!submit}" value="Submit"/>
    </apex:form>
</apex:page>

//CTRL:

public class Testctrl {
    public list<Student__c> acctlist {get;set;}
    public list<Boolean> input {get;set;}
    public list<Id> stuids;
    public list<Attendence__c> attds = new list<Attendence__c>();
    public Integer s;
     
    public Testctrl(){
    system.debug('************checkbox_inputs*****************'+input);
        acctlist = [SELECT Id, Name FROM Student__c];
        s = acctlist.size();
        system.debug('*************recordcount****************'+s);
        system.debug('*************studentlist****************'+acctlist);
        for(Student__c stid: acctlist){
            stuids.add(stid.id);    
        }
        system.debug('************studentids*****************'+stuids);             
    }
    public void submit(){
        for(Integer i=0;i<s;i++){
             attds.add(new Attendence__c(Absent__c = input[i], Student__c = stuids[i]));
        }
        system.debug('************attendence*****************'+attds);
        insert attds;
    }

 
Unless I select any options on tab "Student", i could'nt search any on Tab "Attendence"
Why is this happening?
Visualforce page:

<apex:page standardController="Teacher__c" action="{!fetchFailingPage}" extensions="RGMTeacherController" sidebar="false" showHeader="false">
    <style>
        .activeTab {background-color: #236FBD; color:white; background-image:none}
        .inactiveTab { background-color: lightgrey; color:black; background-image:none}
    </style>
          
      <apex:form id="loginForm" forceSSL="true">
       
            <apex:tabPanel switchType="client" tabClass="activeTab" inactiveTabClass="inactiveTab" selectedTab="Information">
                
                <apex:tab id="home" label="Home" title="Home">                   
                </apex:tab>
                
                <apex:tab label="Information" name="Information" id="InformationTab" >                                         
                </apex:tab>

                <apex:tab id="student" label="Student" title="Student">
                    <apex:pageBlock >
                        <apex:selectList label="Standard" id="choosestandard" required="true"  alue="{!standard}" >
                            <apex:selectOptions value="{!standarditems}" id="standarditem" />                           
                        </apex:selectList> 
                        <apex:selectList label="Section" id="choosesection" required="true" value="{!section}" >
                            <apex:selectOptions value="{!sectionitems}" id="sectionitem" />                           
                        </apex:selectList>
                        <apex:selectList label="Subject" id="choosesubject" required="true" value="{!subject}" >
                            <apex:selectOptions value="{!subjectitems}" id="subjectitem" />                           
                        </apex:selectList>
                        <apex:commandButton action="{!studentsearch}" value="Search" reRender="stulistid" />               
                    
                    
                        <apex:outputPanel id="stulistid" >
                        <apex:pageblocktable value="{!studentlist}" var="a" id="pbTable" >
                            <apex:column value="{!a.Name}"/>
                            <apex:column value="{!a.Roll_Number__c}"/>
                            <apex:column value="{!sfUrl}{!a.Id}"/>
                            <apex:column ><apex:outputLink value="{!URLFOR($Action.Student__c.View, a.id)}">{!a.name}</apex:outputLink></apex:column>
                        </apex:pageblocktable>
                        </apex:outputPanel>
                    </apex:pageBlock>
                </apex:tab>
                
                <apex:tab id="event" label="Events" title="Events">              
                </apex:tab>
                
                <apex:tab id="attendence" label="Attendence" title="Attendence">              
                    
                    <apex:pageBlock title="Make Attendence">                       
                            <apex:pageBlockSection >
                                <apex:selectList label="Standard" id="stustandard" value="{!stanatt}" >
                                    <apex:selectOption itemValue="L.K.G" itemLabel="L.K.G"/>
                                    <apex:selectOption itemValue="U.K.G" itemLabel="U.K.G"/>
                                    <apex:selectOption itemValue="I" itemLabel="I"/>
                                    <apex:selectOption itemValue="II" itemLabel="II"/>                        
                                </apex:selectList>
                                <apex:selectList label="Section" id="stusec" value="{!secatt}" >
                                    <apex:selectOption itemValue="A" itemLabel="A"/>
                                    <apex:selectOption itemValue="B" itemLabel="B"/>                       
                                </apex:selectList>
                            </apex:pageBlockSection>
                            <apex:pageBlockButtons location="Top">
                            <apex:commandButton action="{!makatt}" value="Search" reRender="xyz"/>
                        </apex:pageBlockButtons>
                    </apex:pageBlock>
                    <apex:outputPanel id="xyz">
                    <apex:pageBlock title="Attendence List">                   
                        <apex:pageBlockTable value="{!studentattlist}" var="itr">
                            <apex:column value="{!itr.Name}"/>
                            <apex:column value="{!itr.Roll_Number__c}"/>
                        </apex:pageBlockTable>
                        
                        <apex:pageBlockButtons >
                            <apex:commandButton action="{!saveatt}" value="Save" />
                        </apex:pageBlockButtons>
                    </apex:pageBlock>
                    </apex:outputPanel>              
                </apex:tab>
                
            </apex:tabPanel>
      </apex:form>
       
</apex:page>


Controller:

public class RGMTeacherController {
    public string username {get;set;}
    public string password {get;set;}
    public Boolean showRecords{get;set;}
    public Boolean attbool{get;set;}
    public List<Student__c> studentlist{get;set;}
    public List<Student__c> studentattlist{get;set;}
    public string standard{get;set;}
    public string section{get;set;}
    public string subject{get;set;}
    public string stanatt{get;set;}
    public string secatt{get;set;}
    public string[] sections;
    public string[] standards;
    public string[] subjects;
    public String sfUrl {get;set;}
    public String failingPageResponse { get; set; }

     
    public RGMTeacherController(ApexPages.StandardController controller) {
        attbool = false;
        sfUrl = 'https://c.na34.salesforce.com/';
        Teacher__c TeacherId = [SELECT Id, Name, Email__c, Section__c, Standard__c, Subject__c, Contact_Number__c FROM Teacher__c WHERE Username__c =: username AND Password__c =: password LIMIT 1];
        ApexPages.currentPage().getParameters().put('id', TeacherId.Id);
        sections = TeacherId.Section__c.split(';', 7);
        standards = TeacherId.Standard__c.split(';', 7);
        subjects = TeacherId.Subject__c.split(';', 7);
    }
    public List<SelectOption> getstandarditems() {
        List<SelectOption> standardoptions = new List<SelectOption>();
         for(Integer i=0; i < standards.size(); i++) {
             standardoptions.add(new SelectOption(standards[i], standards[i]));
         }
        return standardoptions;
    }
    
    public String getstandard() {
        return standard;
    }
            
    public void setstandard(String standard) {
        this.standard = standard;
    }
    
    public void fetchFailingPage() {
       try {
           // Make a call to failing sites page here
           failingPageResponse = Page.RGM_Teachers_Page.getContent().toString();
       } catch (Exception e) {
           failingPageResponse = e.getTypeName() + ' : ' + e.getMessage() ;
       }       
    }   
    
    public List<SelectOption> getsectionitems() {
        List<SelectOption> sectionoptions = new List<SelectOption>();
        for(Integer i=0; i < standards.size(); i++) {
             sectionoptions.add(new SelectOption(sections[i], sections[i]));
         }
        return sectionoptions;
    }
    
    public String getsection() {
        return section;
    }
            
    public void setsection(String section) {
        this.section = section;
    }
    
    public List<SelectOption> getsubjectitems() {
        List<SelectOption> subjectoptions = new List<SelectOption>();
        for(Integer i=0; i < subjects.size(); i++) {
             subjectoptions.add(new SelectOption(subjects[i], subjects[i]));
         }
        return subjectoptions;
    }
    
    public String getsubject() {
        return subject;
    }
            
    public void setsubject(String subject) {
        this.subject = subject;
    }
    
    public String getsfurll() {
        return sfURL;      
    }

    public void studentsearch() {
        system.debug('*********************************'+standard);
        studentlist = [SELECT Id, Name, Roll_Number__c FROM Student__c WHERE Standard__c =: standard AND Section__c =: section];
        system.debug('*********************************'+studentlist);
        
    } 
    
    public void makatt() {
        system.debug('***************96******************');
        studentattlist = [SELECT Id, Name, Roll_Number__c FROM Student__c WHERE Standard__c =: stanatt AND Section__c =: secatt];
        system.debug('*********************************'+studentattlist);
        attbool = true;    
    }
    
    public void saveatt() {
              
    }   
    
}
VFP:

<apex:page standardController="Teacher__c" extensions="RGMTeacherController">   
      <apex:form id="loginForm" forceSSL="true">
        
        <apex:outputPanel id="actualblock" >
            <apex:tabPanel switchType="client" tabClass="activeTab" inactiveTabClass="inactiveTab" selectedTab="Information">
                
                <apex:tab id="home" label="Home" title="Home">                   
                </apex:tab>
                
                <apex:tab label="Information" name="Information" id="InformationTab" >                                   ----------------------------------------                    
                </apex:tab>

                <apex:tab id="student" label="Student" title="Student">
                    <apex:pageBlock >
                        <apex:selectList label="Standard" id="choosestandard" required="true" value="{!standard}" >
                            <apex:selectOptions value="{!standarditems}" id="standarditem" />                           
                        </apex:selectList> 
                        <apex:selectList label="Section" id="choosesection" required="true" value="{!section}" >
                            <apex:selectOptions value="{!sectionitems}" id="sectionitem" />                           
                        </apex:selectList>
                        <apex:selectList label="Subject" id="choosesubject" required="true" value="{!subject}" >
                            <apex:selectOptions value="{!subjectitems}" id="subjectitem" />                           
                        </apex:selectList>
                        <apex:commandButton action="{!studentsearch}" value="Search" reRender="stulistid" />           
                        <apex:outputPanel id="stulistid" >
                        <apex:pageblocktable value="{!studentlist}" var="a" id="pbTable" >
                            <apex:column value="{!a.Name}"/>
                            <apex:column value="{!a.Roll_Number__c}"/>
                        </apex:pageblocktable>
                        </apex:outputPanel>
                    </apex:pageBlock>
                </apex:tab>
               
            </apex:tabPanel>
        </apex:outputPanel>
      </apex:form>
       
</apex:page>


CTRL:

public class RGMTeacherController {
    public Boolean showRecords{get;set;}
    public List<Student__c> studentlist{get;set;}
    public string[] standard{get;set;}
    public string[] section{get;set;}
    public string[] subject{get;set;}
    public string[] sections;
    public string[] standards;
    public string[] subjects;
     
    public RGMTeacherController(ApexPages.StandardController controller) {
 
        Teacher__c TeacherId = [SELECT Id, Name, Email__c, Section__c, Standard__c, Subject__c, Contact_Number__c FROM Teacher__c WHERE Username__c =: username AND Password__c =: password LIMIT 1];
        ApexPages.currentPage().getParameters().put('id', TeacherId.Id);
        sections = TeacherId.Section__c.split(';', 7);
        standards = TeacherId.Standard__c.split(';', 7);
        subjects = TeacherId.Subject__c.split(';', 7);
    }
    public List<SelectOption> getstandarditems() {
        List<SelectOption> standardoptions = new List<SelectOption>();
         for(Integer i=0; i < standards.size(); i++) {
             standardoptions.add(new SelectOption(standards[i], standards[i]));
         }
        return standardoptions;
    }
    
    public String[] getstandard() {
        return standard;
    }
            
    public void setstandard(String[] standard) {
        this.standard = standard;
    }
    
    public List<SelectOption> getsectionitems() {
        List<SelectOption> sectionoptions = new List<SelectOption>();
        for(Integer i=0; i < standards.size(); i++) {
             sectionoptions.add(new SelectOption(sections[i], sections[i]));
         }
        return sectionoptions;
    }
    
    public String[] getsection() {
        return section;
    }
            
    public void setsection(String[] section) {
        this.section = section;
    }
    
    public List<SelectOption> getsubjectitems() {
        List<SelectOption> subjectoptions = new List<SelectOption>();
        system.debug('*********************************'+standard);
        for(Integer i=0; i < subjects.size(); i++) {
             subjectoptions.add(new SelectOption(subjects[i], subjects[i]));
         }
        return subjectoptions;
    }
    
    public String[] getsubject() {
        return subject;
    }
            
    public void setsubject(String[] subject) {
        this.subject = subject;
    }
    
    public void studentsearch() {
        system.debug('*********************************'+standard);
        studentlist = [SELECT Id, Name, Roll_Number__c FROM Student__c WHERE Standard__c =: standard AND Section__c =: section];
        system.debug('*********************************'+studentlist);
        
    }   
    
}
Hi,
we are implementing session cache for faster reloads. So I have theses following questions.

1.Lets say I have session cached an Account record and the account record is manually updated later by an Agent.
   In this scenario, how does the session cache gets updated.
2.what should be session cached and what should not?

Thanks in Advance,
Vijay
Initially I have set all the InputCheckbox values to false. And shown the values on PageblockTable in VFP. When user changes the checkbox values and click submit, I wanted to get all the new Checkbox values. How can i do that.
 
//VFP:

<apex:page controller="Testctrl">
    <apex:form >
    <apex:pageBlock >
        <apex:pageBlockTable value="{!attdmap}" var="attdkey">
        
            <apex:column value="{!attdkey.Name}"/>
            <apex:column>
                <apex:facet name="header">Absent</apex:facet>
                <apex:inputCheckbox label="Absent" value="{!attdmap[attdkey]}" />
            </apex:column>

        </apex:pageBlockTable>
    </apex:pageBlock>
    
    <apex:commandButton action="{!submit}" value="Submit"/>
    </apex:form>
</apex:page>



//CTRL:

public class Testctrl {
    public list<Student__c> acctlist {get;set;}
    public Map<Student__c, Boolean> attdmap{get;set;}
     
    public Testctrl(){
        attdmap = new Map<Student__c, Boolean>();
        acctlist = [SELECT Id, Name FROM Student__c];

        for(Student__c atu23 : acctlist){
        attdmap.put(atu23,False);
        }
       
    }
    public void submit(){
    }

}

 
<apex:page controller="Testctrl">
    <apex:form >
        <apex:repeat value="{!attdmap}" var="attdkey" >
            <apex:OutputText value="{!attdkey}"/>
            <apex:OutputText value="{!attdmap[attdkey]}"/>
       </apex:repeat>
    </apex:form>
</apex:page>



public class Testctrl {
    public list<Student__c> acctlist {get;set;}
    public Map<Student__c, Boolean> attdmap{get;set;}
     
    public Testctrl(){
        Map<Student__c, Boolean> attdmap = new Map<Student__c, Boolean>();
        acctlist = [SELECT Id, Name FROM Student__c];
        for(Student__c atu23 : acctlist){
        attdmap.put(atu23,false);
        }        
    }

}
Hi All,

Please bear with me since I am a complete newbie with Apex. I need assistance building APEX to count the number of Notes (Standard Object) in Parent object (Custom Object).

I would appreciate if you can share your code.
Multiple records from Student__c are shown on VFP with inputcheckbox. I want to save the input checkbox values and the Student__c Id's in child records.
//VFP:

<apex:page controller="Testctrl">
    <apex:form >
    <apex:repeat value="{!acctlist}" var="accs" >
        <apex:outputText value="{!accs.Name}"></apex:outputText>
        <apex:inputCheckbox value="{!input}" >
        </apex:inputCheckbox><br/>
    </apex:repeat>
    <apex:commandButton action="{!submit}" value="Submit"/>
    </apex:form>
</apex:page>

//CTRL:

public class Testctrl {
    public list<Student__c> acctlist {get;set;}
    public list<Boolean> input {get;set;}
    public list<Id> stuids;
    public list<Attendence__c> attds = new list<Attendence__c>();
    public Integer s;
     
    public Testctrl(){
    system.debug('************checkbox_inputs*****************'+input);
        acctlist = [SELECT Id, Name FROM Student__c];
        s = acctlist.size();
        system.debug('*************recordcount****************'+s);
        system.debug('*************studentlist****************'+acctlist);
        for(Student__c stid: acctlist){
            stuids.add(stid.id);    
        }
        system.debug('************studentids*****************'+stuids);             
    }
    public void submit(){
        for(Integer i=0;i<s;i++){
             attds.add(new Attendence__c(Absent__c = input[i], Student__c = stuids[i]));
        }
        system.debug('************attendence*****************'+attds);
        insert attds;
    }

 
Unless I select any options on tab "Student", i could'nt search any on Tab "Attendence"
Why is this happening?
Visualforce page:

<apex:page standardController="Teacher__c" action="{!fetchFailingPage}" extensions="RGMTeacherController" sidebar="false" showHeader="false">
    <style>
        .activeTab {background-color: #236FBD; color:white; background-image:none}
        .inactiveTab { background-color: lightgrey; color:black; background-image:none}
    </style>
          
      <apex:form id="loginForm" forceSSL="true">
       
            <apex:tabPanel switchType="client" tabClass="activeTab" inactiveTabClass="inactiveTab" selectedTab="Information">
                
                <apex:tab id="home" label="Home" title="Home">                   
                </apex:tab>
                
                <apex:tab label="Information" name="Information" id="InformationTab" >                                         
                </apex:tab>

                <apex:tab id="student" label="Student" title="Student">
                    <apex:pageBlock >
                        <apex:selectList label="Standard" id="choosestandard" required="true"  alue="{!standard}" >
                            <apex:selectOptions value="{!standarditems}" id="standarditem" />                           
                        </apex:selectList> 
                        <apex:selectList label="Section" id="choosesection" required="true" value="{!section}" >
                            <apex:selectOptions value="{!sectionitems}" id="sectionitem" />                           
                        </apex:selectList>
                        <apex:selectList label="Subject" id="choosesubject" required="true" value="{!subject}" >
                            <apex:selectOptions value="{!subjectitems}" id="subjectitem" />                           
                        </apex:selectList>
                        <apex:commandButton action="{!studentsearch}" value="Search" reRender="stulistid" />               
                    
                    
                        <apex:outputPanel id="stulistid" >
                        <apex:pageblocktable value="{!studentlist}" var="a" id="pbTable" >
                            <apex:column value="{!a.Name}"/>
                            <apex:column value="{!a.Roll_Number__c}"/>
                            <apex:column value="{!sfUrl}{!a.Id}"/>
                            <apex:column ><apex:outputLink value="{!URLFOR($Action.Student__c.View, a.id)}">{!a.name}</apex:outputLink></apex:column>
                        </apex:pageblocktable>
                        </apex:outputPanel>
                    </apex:pageBlock>
                </apex:tab>
                
                <apex:tab id="event" label="Events" title="Events">              
                </apex:tab>
                
                <apex:tab id="attendence" label="Attendence" title="Attendence">              
                    
                    <apex:pageBlock title="Make Attendence">                       
                            <apex:pageBlockSection >
                                <apex:selectList label="Standard" id="stustandard" value="{!stanatt}" >
                                    <apex:selectOption itemValue="L.K.G" itemLabel="L.K.G"/>
                                    <apex:selectOption itemValue="U.K.G" itemLabel="U.K.G"/>
                                    <apex:selectOption itemValue="I" itemLabel="I"/>
                                    <apex:selectOption itemValue="II" itemLabel="II"/>                        
                                </apex:selectList>
                                <apex:selectList label="Section" id="stusec" value="{!secatt}" >
                                    <apex:selectOption itemValue="A" itemLabel="A"/>
                                    <apex:selectOption itemValue="B" itemLabel="B"/>                       
                                </apex:selectList>
                            </apex:pageBlockSection>
                            <apex:pageBlockButtons location="Top">
                            <apex:commandButton action="{!makatt}" value="Search" reRender="xyz"/>
                        </apex:pageBlockButtons>
                    </apex:pageBlock>
                    <apex:outputPanel id="xyz">
                    <apex:pageBlock title="Attendence List">                   
                        <apex:pageBlockTable value="{!studentattlist}" var="itr">
                            <apex:column value="{!itr.Name}"/>
                            <apex:column value="{!itr.Roll_Number__c}"/>
                        </apex:pageBlockTable>
                        
                        <apex:pageBlockButtons >
                            <apex:commandButton action="{!saveatt}" value="Save" />
                        </apex:pageBlockButtons>
                    </apex:pageBlock>
                    </apex:outputPanel>              
                </apex:tab>
                
            </apex:tabPanel>
      </apex:form>
       
</apex:page>


Controller:

public class RGMTeacherController {
    public string username {get;set;}
    public string password {get;set;}
    public Boolean showRecords{get;set;}
    public Boolean attbool{get;set;}
    public List<Student__c> studentlist{get;set;}
    public List<Student__c> studentattlist{get;set;}
    public string standard{get;set;}
    public string section{get;set;}
    public string subject{get;set;}
    public string stanatt{get;set;}
    public string secatt{get;set;}
    public string[] sections;
    public string[] standards;
    public string[] subjects;
    public String sfUrl {get;set;}
    public String failingPageResponse { get; set; }

     
    public RGMTeacherController(ApexPages.StandardController controller) {
        attbool = false;
        sfUrl = 'https://c.na34.salesforce.com/';
        Teacher__c TeacherId = [SELECT Id, Name, Email__c, Section__c, Standard__c, Subject__c, Contact_Number__c FROM Teacher__c WHERE Username__c =: username AND Password__c =: password LIMIT 1];
        ApexPages.currentPage().getParameters().put('id', TeacherId.Id);
        sections = TeacherId.Section__c.split(';', 7);
        standards = TeacherId.Standard__c.split(';', 7);
        subjects = TeacherId.Subject__c.split(';', 7);
    }
    public List<SelectOption> getstandarditems() {
        List<SelectOption> standardoptions = new List<SelectOption>();
         for(Integer i=0; i < standards.size(); i++) {
             standardoptions.add(new SelectOption(standards[i], standards[i]));
         }
        return standardoptions;
    }
    
    public String getstandard() {
        return standard;
    }
            
    public void setstandard(String standard) {
        this.standard = standard;
    }
    
    public void fetchFailingPage() {
       try {
           // Make a call to failing sites page here
           failingPageResponse = Page.RGM_Teachers_Page.getContent().toString();
       } catch (Exception e) {
           failingPageResponse = e.getTypeName() + ' : ' + e.getMessage() ;
       }       
    }   
    
    public List<SelectOption> getsectionitems() {
        List<SelectOption> sectionoptions = new List<SelectOption>();
        for(Integer i=0; i < standards.size(); i++) {
             sectionoptions.add(new SelectOption(sections[i], sections[i]));
         }
        return sectionoptions;
    }
    
    public String getsection() {
        return section;
    }
            
    public void setsection(String section) {
        this.section = section;
    }
    
    public List<SelectOption> getsubjectitems() {
        List<SelectOption> subjectoptions = new List<SelectOption>();
        for(Integer i=0; i < subjects.size(); i++) {
             subjectoptions.add(new SelectOption(subjects[i], subjects[i]));
         }
        return subjectoptions;
    }
    
    public String getsubject() {
        return subject;
    }
            
    public void setsubject(String subject) {
        this.subject = subject;
    }
    
    public String getsfurll() {
        return sfURL;      
    }

    public void studentsearch() {
        system.debug('*********************************'+standard);
        studentlist = [SELECT Id, Name, Roll_Number__c FROM Student__c WHERE Standard__c =: standard AND Section__c =: section];
        system.debug('*********************************'+studentlist);
        
    } 
    
    public void makatt() {
        system.debug('***************96******************');
        studentattlist = [SELECT Id, Name, Roll_Number__c FROM Student__c WHERE Standard__c =: stanatt AND Section__c =: secatt];
        system.debug('*********************************'+studentattlist);
        attbool = true;    
    }
    
    public void saveatt() {
              
    }   
    
}
VFP:

<apex:page standardController="Teacher__c" extensions="RGMTeacherController">   
      <apex:form id="loginForm" forceSSL="true">
        
        <apex:outputPanel id="actualblock" >
            <apex:tabPanel switchType="client" tabClass="activeTab" inactiveTabClass="inactiveTab" selectedTab="Information">
                
                <apex:tab id="home" label="Home" title="Home">                   
                </apex:tab>
                
                <apex:tab label="Information" name="Information" id="InformationTab" >                                   ----------------------------------------                    
                </apex:tab>

                <apex:tab id="student" label="Student" title="Student">
                    <apex:pageBlock >
                        <apex:selectList label="Standard" id="choosestandard" required="true" value="{!standard}" >
                            <apex:selectOptions value="{!standarditems}" id="standarditem" />                           
                        </apex:selectList> 
                        <apex:selectList label="Section" id="choosesection" required="true" value="{!section}" >
                            <apex:selectOptions value="{!sectionitems}" id="sectionitem" />                           
                        </apex:selectList>
                        <apex:selectList label="Subject" id="choosesubject" required="true" value="{!subject}" >
                            <apex:selectOptions value="{!subjectitems}" id="subjectitem" />                           
                        </apex:selectList>
                        <apex:commandButton action="{!studentsearch}" value="Search" reRender="stulistid" />           
                        <apex:outputPanel id="stulistid" >
                        <apex:pageblocktable value="{!studentlist}" var="a" id="pbTable" >
                            <apex:column value="{!a.Name}"/>
                            <apex:column value="{!a.Roll_Number__c}"/>
                        </apex:pageblocktable>
                        </apex:outputPanel>
                    </apex:pageBlock>
                </apex:tab>
               
            </apex:tabPanel>
        </apex:outputPanel>
      </apex:form>
       
</apex:page>


CTRL:

public class RGMTeacherController {
    public Boolean showRecords{get;set;}
    public List<Student__c> studentlist{get;set;}
    public string[] standard{get;set;}
    public string[] section{get;set;}
    public string[] subject{get;set;}
    public string[] sections;
    public string[] standards;
    public string[] subjects;
     
    public RGMTeacherController(ApexPages.StandardController controller) {
 
        Teacher__c TeacherId = [SELECT Id, Name, Email__c, Section__c, Standard__c, Subject__c, Contact_Number__c FROM Teacher__c WHERE Username__c =: username AND Password__c =: password LIMIT 1];
        ApexPages.currentPage().getParameters().put('id', TeacherId.Id);
        sections = TeacherId.Section__c.split(';', 7);
        standards = TeacherId.Standard__c.split(';', 7);
        subjects = TeacherId.Subject__c.split(';', 7);
    }
    public List<SelectOption> getstandarditems() {
        List<SelectOption> standardoptions = new List<SelectOption>();
         for(Integer i=0; i < standards.size(); i++) {
             standardoptions.add(new SelectOption(standards[i], standards[i]));
         }
        return standardoptions;
    }
    
    public String[] getstandard() {
        return standard;
    }
            
    public void setstandard(String[] standard) {
        this.standard = standard;
    }
    
    public List<SelectOption> getsectionitems() {
        List<SelectOption> sectionoptions = new List<SelectOption>();
        for(Integer i=0; i < standards.size(); i++) {
             sectionoptions.add(new SelectOption(sections[i], sections[i]));
         }
        return sectionoptions;
    }
    
    public String[] getsection() {
        return section;
    }
            
    public void setsection(String[] section) {
        this.section = section;
    }
    
    public List<SelectOption> getsubjectitems() {
        List<SelectOption> subjectoptions = new List<SelectOption>();
        system.debug('*********************************'+standard);
        for(Integer i=0; i < subjects.size(); i++) {
             subjectoptions.add(new SelectOption(subjects[i], subjects[i]));
         }
        return subjectoptions;
    }
    
    public String[] getsubject() {
        return subject;
    }
            
    public void setsubject(String[] subject) {
        this.subject = subject;
    }
    
    public void studentsearch() {
        system.debug('*********************************'+standard);
        studentlist = [SELECT Id, Name, Roll_Number__c FROM Student__c WHERE Standard__c =: standard AND Section__c =: section];
        system.debug('*********************************'+studentlist);
        
    }   
    
}