function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sreejasreeja 

soql qurey

 i had created a custom object of emplye data  with feilds  like   name , experience, address, salary ,and created a record and got the recordid ='allxxwe22522' .. i need to create a class with all the details of that id and display it    :  
 note:  with out using the pageblock and pageblock table should have to display it. how is it possible








 }
 }
Best Answer chosen by sreeja
FARSANA PSFARSANA PS
Hi priya,
You can use apex:repeat  or apex:datatable

Try this sample code:

VF page
<apex:page controller="emp_controller">
 <apex:form >       
   <table border="0" >
        <tr>
            <th>Name</th><th>Address</th>
            <th>Salary</th><th>Experience</th>
        </tr>
        <apex:repeat var="ac" value="{!emplist}">
        <tr>
            <td>{!ac.name}</td>
            <td>{!ac.address__c}</td>
            <td>{!ac.salary__c}</td>
            <td>{!ac.experience__c}</td>
        </tr>
        </apex:repeat> 
    </table>    
</apex:form>
</apex:page>

Controller:
public class emp_controller {
       public list<emp__c> empList {get;set;}
  
       public emp_controller()
       {
           empList=[select id,name,experiance__c,address__c,salary__c  from emp__c limit 100];
       }
}

Hope this helps...

All Answers

FARSANA PSFARSANA PS
Hi priya,
You can use apex:repeat  or apex:datatable

Try this sample code:

VF page
<apex:page controller="emp_controller">
 <apex:form >       
   <table border="0" >
        <tr>
            <th>Name</th><th>Address</th>
            <th>Salary</th><th>Experience</th>
        </tr>
        <apex:repeat var="ac" value="{!emplist}">
        <tr>
            <td>{!ac.name}</td>
            <td>{!ac.address__c}</td>
            <td>{!ac.salary__c}</td>
            <td>{!ac.experience__c}</td>
        </tr>
        </apex:repeat> 
    </table>    
</apex:form>
</apex:page>

Controller:
public class emp_controller {
       public list<emp__c> empList {get;set;}
  
       public emp_controller()
       {
           empList=[select id,name,experiance__c,address__c,salary__c  from emp__c limit 100];
       }
}

Hope this helps...
This was selected as the best answer
sreejasreeja
thank you so much my dear frnd #farsana..  can you provide some  your gmail id, i have smal quries.. i need to  clear you .. because i cant paste the code here
sreejasreeja
hi farsana !!cant we call the values directly in visualforce page  by using :  {empList.name}

 
FARSANA PSFARSANA PS
hi priya,
 If we have a single object (eg: emp__c  empList) we can use {empList.name}, but here I use a list of object (  list<emp__c> ),in that case <apex:repeat >is needed