Skip to content

Instantly share code, notes, and snippets.

@sankaran1984
Created February 23, 2017 08:45
Show Gist options
  • Save sankaran1984/dd1b908f41bc0727f81823a2daf58a5c to your computer and use it in GitHub Desktop.
Save sankaran1984/dd1b908f41bc0727f81823a2daf58a5c to your computer and use it in GitHub Desktop.
visualforce - Beyond Basics
<apex:page controller="testclass1_23022017">
<apex:sectionHeader title="Global Search Box"/>
<apex:form >
<apex:outputLabel value="Enter you search text here "/>
<apex:inputText value="{!searchStr}"/>
<apex:commandButton value="Go" action="{!startSearch}" rerender="DisplayArea"/>
</apex:form>
<apex:outputPanel id="DisplayArea">
<apex:outputPanel rendered="{!results != Null}">
<apex:pageBlock >
<!-- For each Object, like Account, Opportunity, Product2 -->
<apex:repeat value="{!results}" var="objName">
<apex:sectionHeader subtitle="{!objName}"/>
<!-- For each row -->
<apex:pageBlockTable value="{!results[objName]}" var="rec" >
<!-- For each field -->
<apex:repeat value="{!rec}" var="field">
<apex:column value="{!rec[field]}" headerValue="{!field}"/>
</apex:repeat>
</apex:pageBlockTable>
</apex:repeat>
</apex:pageBlock>
</apex:outputPanel>
</apex:outputPanel>
</apex:page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment