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
lapaullapaul 

How to display returned results in Vforce page

Hi,

I have a simple SOSL like this "Select Title from ContentVersion". However I don't know how to

display the returned result in Visual Force page. Please help.

 

thanks

Paul

 

lapaullapaul

thanks for your reply. I found one of the article is very helpful. it is the Controller Method with the

Lead search example. Does SOQL support wild card?

 

Select Name, Email, Phone From Lead where Name like %searchText%

 

does it work for the SOQL above? please advice.

 

thanks

 

splitsplit

For example.

 

Controller:

 

public class Test { public Test(ApexPages.StandardController controller) { } public ApexPages.StandardSetController setLead {get { if(setLead == null) {setLead = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT Id, name, email, phone FROM Lead where name like 'a%'])); } return setLead; }set; } public List<Lead> getLeads() { return (List<Lead>) setLead.getRecords(); } }

 Vf page:

 

<apex:page standardController="Lead" extensions="Test"> <apex:pageBlock > <apex:pageBlockTable value="{!Leads}" var="l"> <apex:column value="{!l.id}"/> <apex:column value="{!l.name}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>

 

I so sorry. I can't give a full answer, because I know english very bad.