Skip to main content

Clicking on a button and moving to a new page with questions:

public PageReference runTest () {

insert newSession;

PageReference ref = new PageReference ('/apex/LaunchTests');

return ref;

}

Controller:

public class LaunchTestsController {

public List <Test_item__c> newItem { get; set;}

public LaunchTestsController () {

string str = 'SELECT Id, Question__c, Response__c, Response1__c, Responce2__c, Answer__c FROM Test_item__c';

this.newItem = Database.query(str);

}

}

VF Page:

<apex:page controller="LaunchTestsController" >

<apex:form >

<apex:pageBlock title="Questions">

<apex:pageBlockTable value="{!newItem}" var="item">

<apex:column value="{!item.Question__c}"/>

</apex:pageBlockTable>

</apex:pageBlock>

</apex:form>

</apex:page>

 
4 Antworten
0/9000