Skip to main content
I have the below VF Page with 10 custom buttons,

<apex:page id="TeacherKPI_VF" controller="TeacherKPI_VF_Controller">

  <apex:form >

  <div style="text-align:center;">

      <h1 style="text-decoration: underline;">TEACHER'S KPI</h1><br/><br/>

      <apex:commandButton value="Lesson Observation" action="{!LessonObservation_VF}"/><br/><br/>

      <apex:commandButton value="File Check" action="{!FileCheck_VF}"/><br/><br/>

      <apex:commandButton value="Request for Corrective Action" action="{!RequestforCorrectiveAction_VF}"/><br/><br/>

      <apex:commandButton value="Withdrawal Trend" action="{!WithdrawalTrend_VF}"/><br/><br/>              

      <apex:commandButton value="Cost Recoverability Index" action="{!CostRecoverabilityIndex_VF}"/><br/><br/>

      <apex:commandButton value="Teacher Parent Dialogue Log" action="{!TeacherParentDialogueLog_VF}"/><br/><br/>

      <apex:commandButton value="Training sessions" action="{!TrainingSessions_VF}"/><br/><br/>

      <apex:commandButton value="Parent's Survey" action="{!ParentSurvey_VF}"/><br/><br/>

      <apex:commandButton value="Student's Survey" action="{!StudentSurvey_VF}"/><br/><br/>

      <apex:commandButton value="Leave / MC" action="{!LeaveMC_VF}"/><br/><br/>

      <apex:commandButton value="Back" action="{!Back}"/>      

  </div>

  </apex:form>

</apex:page>

When any of the button is click, need to open another VF PAGEs for example

<apex:commandButton value="Lesson Observation" action="{!LessonObservation_VF}"/><br/><br/> need to open VF Page LessonObservation_VF, I am not sure on how to do this, please help

The Class is not complete yet

public with sharing class TeacherKPI_VF_Controller {

    public PageReference Back() {

        return null;

    }

    public PageReference LeaveMC_VF() {

        return null;

    }

    public PageReference StudentSurvey_VF() {

        return null;

    }

    public PageReference ParentSurvey_VF() {

        return null;

    }

    public PageReference TrainingSessions_VF() {

        return null;

    }

    public PageReference TeacherParentDialogueLog_VF() {

        return null;

    }

    public PageReference CostRecoverabilityIndex_VF() {

        return null;

    }

    public PageReference WithdrawalTrend_VF() {

        return null;

    }

    public PageReference RequestforCorrectiveAction_VF() {

        return null;

    }

    public PageReference FileCheck_VF() {

        return null;

    }

    public PageReference LessonObservation_VF() {

        return null;

    }

}

 
6 Antworten
  1. 19. Juli 2017, 10:16
    Hi mw6,

    Find the code sample code below to redirect from one vf page to another vf page.

    Example :

     public PageReference LeaveMC_VF() {

           PageReference p = new PageReference('/apex/<your_page_name>');

           p.setRedirect(true);

    return p;

           

        }

    Hope this Helps your problem.

    Thanks,

    Ram
0/9000