Created
February 23, 2017 08:45
-
-
Save sankaran1984/dd1b908f41bc0727f81823a2daf58a5c to your computer and use it in GitHub Desktop.
visualforce - Beyond Basics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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