Sunday, March 10, 2013

Usage of "image", "PanelBar" and "iframe" tags in Visualforce Page


Displaying the Image using "image" tag in Visualforce Page:

<apex:page >
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection title="Section1" >
<apex:image value="{!$Resource.Bhills}" style="height:150px; width:150px"/>
<apex:image value="{!$Resource.Bhills}" style="height:150px; width:150px"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

Displaying the one visualforce page in another visualforce page using "iframe" tag:

Ex:1

<apex:page >
<apex:form >
<apex:PageBlock title="Iframe">
<apex:iframe src="/apex/records"/><!-- Here records is a vf page which is we already created-->
</apex:PageBlock>
</apex:form>
</apex:page>

Ex:2


<apex:page standardController="Account" recordSetVar="accs">
 <apex:tabpanel switchtype="client" >
     <apex:tab label="Jntu" title="Account">
         <apex:iframe src="http://jntu.ac.in" height="500px" scrolling="true"/>
     </apex:tab>
     <apex:tab label="Accounts" title="Account">
         <apex:pageBlock >
             <apex:pageblockTable value="{!accs}" var="a">
                 <apex:column value="{!a.name}"/>
                 <apex:column value="{!a.fax}"/>
                 <apex:column value="{!a.phone}"/>
             </apex:pageblockTable>
         </apex:pageBlock>
     </apex:tab>     
 </apex:tabpanel>
</apex:page>

Creating Panel Bar and Panel Bar Items on Visualforce Page


<apex:page >
<apex:form >
  <apex:panelBar >
      <Apex:PanelBarItem >
          <Apex:CommandLink value="Google" action="https://www.google.com"/>
          <Apex:CommandLink value="Gmail" action="https://www.gmail.com"/>
      </Apex:PanelBarItem>
  </apex:panelBar>
 </apex:form> 
</apex:page>

No comments:

Post a Comment