• Surya Kallakuri
  • NEWBIE
  • 20 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
 
visual force:
Code:
<apex:page controller="searchcls" >
  <apex:form >
  <apex:pageBlock >
  <apex:inputText value="{!stringval}"/>
  <apex:commandButton value="search" action="{!search}"/>
  </apex:pageBlock>
  <apex:pageBlock >
  <apex:pageblockTable value="{!acctlst}" var="a">
  <apex:column headerValue="Account Name" value="{!a.name}"/>
  <apex:column headerValue="Fax" value="{!a.Fax}"/>
  <apex:column headerValue="Phone" value="{!a.phone}"/>
  <apex:column headerValue="Billingcountry" value="{!a.billingcountry}"/>
  <apex:column headerValue="Billingstate" value="{!a.billingstate}"/>
  </apex:pageblockTable>
  </apex:pageBlock>
  </apex:form>
</apex:page>

Apex controller:
 public class searchcls {
    public List<Account> acctlst { get; set; }
    public String stringval { get; set; }
    public PageReference search() {
       acctlst = (List<Account>)[FIND: stringval RETURNING Account(name, fax, phone, billingstate, billingcountry)][0];       
         if(acctlst =! null) return 'acctlst';
    if(acctlst == null) return 'unknown';
   }
}
 
 
<apex:page standardController="Account" recordsetvar="acc" extensions="paginationcls2">
<apex:form >
<apex:pageBlock >
<apex:pageblockTable value="{!acc}" var="a">
<apex:column value="{!a.name}"/> 
<apex:outputLink value="/{$acc.name}">{$acc.name}</apex:outputLink>
</apex:pageblockTable>
<apex:tabPanel switchType="client">
<apex:commandButton value="previous" action="{!previous}"/>
<apex:commandButton value="Next" action="{!next}"/>
</apex:tabPanel>
</apex:pageBlock>
</apex:form>  
</apex:page>
 
visual force:
Code:
<apex:page controller="searchcls" >
  <apex:form >
  <apex:pageBlock >
  <apex:inputText value="{!stringval}"/>
  <apex:commandButton value="search" action="{!search}"/>
  </apex:pageBlock>
  <apex:pageBlock >
  <apex:pageblockTable value="{!acctlst}" var="a">
  <apex:column headerValue="Account Name" value="{!a.name}"/>
  <apex:column headerValue="Fax" value="{!a.Fax}"/>
  <apex:column headerValue="Phone" value="{!a.phone}"/>
  <apex:column headerValue="Billingcountry" value="{!a.billingcountry}"/>
  <apex:column headerValue="Billingstate" value="{!a.billingstate}"/>
  </apex:pageblockTable>
  </apex:pageBlock>
  </apex:form>
</apex:page>

Apex controller:
 public class searchcls {
    public List<Account> acctlst { get; set; }
    public String stringval { get; set; }
    public PageReference search() {
       acctlst = (List<Account>)[FIND: stringval RETURNING Account(name, fax, phone, billingstate, billingcountry)][0];       
         if(acctlst =! null) return 'acctlst';
    if(acctlst == null) return 'unknown';
   }
}
 
 
<apex:page standardController="Account" recordsetvar="acc" extensions="paginationcls2">
<apex:form >
<apex:pageBlock >
<apex:pageblockTable value="{!acc}" var="a">
<apex:column value="{!a.name}"/> 
<apex:outputLink value="/{$acc.name}">{$acc.name}</apex:outputLink>
</apex:pageblockTable>
<apex:tabPanel switchType="client">
<apex:commandButton value="previous" action="{!previous}"/>
<apex:commandButton value="Next" action="{!next}"/>
</apex:tabPanel>
</apex:pageBlock>
</apex:form>  
</apex:page>