• SFDC Bayya
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
select id,name, (select id  from contact) from account where id =:accountid

i dont understand where i am going wrong can any one guide me
how can compare selecetde radio button value wiyh one field ..

<apex:page controller="sec_paging" showHeader="false" standardStylesheets="false">
    <apex:form style="background-color:#56A5EC;">
        <marquee><h1><font color="white" size="6">
                    WELCOME TO ONLINE TEST , ALL THE BEST</font>
                </h1></marquee>
    <center>
        <apex:pageBlock id="pb">
            <apex:pageBlockSection title="Question Section">
                <apex:pageBlockTable value="{!qrecs}" var="a" styleClass="{.b}"><br></br>
                    <apex:column value="Q).{!a.qstn__c}" style="font-size:30px;color:#22ff66"/>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
       
        <apex:pageBlockSection title="Answer Section" >
             <apex:pageBlockTable value="{!qrecs}" var="a" >
               <center>
                 <apex:column >
                     <apex:selectRadio onselect="score" >                
                         <apex:selectOption itemValue="{!a.A__c}" itemLabel="{!a.A__c}"/>
                         <apex:selectOption itemValue="{!a.B__c}" itemLabel="{!a.B__c}"/>
                         <apex:selectOption itemValue="{!a.C__c}" itemLabel="{!a.C__c}"/>
                         <apex:selectOption itemValue="{!a.D__c}" itemLabel="{!a.D__c}"/>
                     </apex:selectRadio>
                </apex:column></center>
              </apex:pageBlockTable>
        </apex:pageBlockSection>
       
        <apex:pageBlockButtons >
            <apex:commandButton value="submit" action="{!count}"/>
        </apex:pageBlockButtons>
           
        <apex:panelGrid columns="6">
            <apex:commandButton value="First" action="{!mfirst}" disabled="{!!phasPrevious}" status="fetchStatus1" reRender="pb" title="First Page"/>
           
            <apex:commandButton value="Prev" action="{!mprevious}" disabled="{!!phasPrevious}" status="fetchStatus" reRender="pb"  title="Previous Page 123"/>
           
            <apex:commandButton value="Next" action="{!mnext}" disabled="{!!phasNext}" status="fetchStatus" reRender="pb"  title="Next Page"/>
           
            <apex:commandButton value="Last" action="{!mlast}" disabled="{!!phasNext}" status="fetchStatus" reRender="pb" title="Last Page"/>
           
            <apex:outputText >
                {!(ppageNumber * size)+1-size} -
                {!IF((ppageNumber * size)>noOfRecords, 
                noOfRecords,
                (ppageNumber * size))}
                of {!noOfRecords}
               
            </apex:outputText>
           
           
            <apex:commandButton value="Refresh ..." action="{!mrefresh}" status="fetchStatus" reRender="pb" title="Refresh Page"/>
           
            <apex:outputPanel style="color:red;font-weight:bold">
                <apex:actionStatus id="fetchStatus1" startText="Fetching FirtPage Data ..." startStyle="color:red" stopText=""/>
                <apex:actionStatus id="fetchStatus" startText="Fetching Data ..." stopText=""/>
            </apex:outputPanel>
           
       </apex:panelGrid>
  </apex:pageBlock>
       
      <apex:pageBlock rendered="{!resultblock}">
          <apex:outputText value="Thank you for attempted"></apex:outputText><br></br>
            <apex:outputLabel value="{!marks}"></apex:outputLabel>
        <apex:image id="theImage" value="{!$Resource.good_luck}" width="200" height="200"/>       
       
         
        </apex:pageBlock></center>
    </apex:form>
</apex:page>
----------------------------------------------------------
public with sharing class sec_paging {
    public sec_paging(){
      
        resultblock=false;
    }

    Public Integer noOfRecords{get; set;}
    Public Integer size{get;set;}
    public integer marks{set;get;}//to count the score
    public boolean resultblock{set;get;}
  
    Public List<vin__Question__c> getQrecs(){
   
        List<vin__Question__c> lq = new List<vin__Question__c>();   
   
for(vin__Question__c q : (List<vin__Question__c>)setCon.getRecords()) 
// as per pagenumber records assigns to acclist
        lq.add(q);
   
    return lq;
                                    // Assigning acclist to PageBlocktable
   
             //acclist =[select id,name from account];
   //return  acclist;
    }
  
  
    public ApexPages.StandardSetController setCon {

        get{//getSetcon
            if(setCon == null){
                    size = 1;
string st = 'Select vin__qstn__c,A__c,B__c,C__c,D__c from vin__Question__c';
           
            setCon = new
                                 ApexPages.StandardSetController(Database.getQueryLocator(st));
            setCon.setPageSize(size);
            noOfRecords = setCon.getResultSize();
            }
        return setCon;
              }
    set;
    }

//////////////////////////////////   
  
    public void mfirst() {
    setCon.first(); // sets (setcon) standardconroller pagenumber to 1
    }
    public void mlast() {        // sets pagenumber to last pagenumber
    setCon.last();
    }
    public void mprevious() {   // Decrease one value of controller pagesize
    setCon.previous();
    }
    public void mnext() {
    setCon.next();      // sets controller to Next Pagenumber i.e Increment one to pn
    }
  
/////////////////////////////////////////////////////////  

    public Boolean phasPrevious {
    get {
        return setCon.getHasPrevious(); 
    }
    set;
    }
  
    public Boolean phasNext {
    get {
        return setCon.getHasNext();
    }
    set;
    }

////////////////////////////////////////////////////////
 
    public Integer ppageNumber {
    get {
    return setCon.getPageNumber();

  // getPageNumber() is standarfunction returns current pagenumber
    }
    set;
    }
  
    public pageReference mrefresh() {
    setCon = null;
    getQrecs();
    setCon.setPageNumber(5);
    return null;
    }
    public integer count(){
        resultblock=true;
        return marks;
    }
    public void score(){
        vin__Question__c v= new vin__Question__c();   
        if(true){
            // to compare Answer__c(custom field) with selected radio button
            marks++;
        }
    }
}
select id,name, (select id  from contact) from account where id =:accountid

i dont understand where i am going wrong can any one guide me
how can compare selecetde radio button value wiyh one field ..