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
Ram Shiva KumarRam Shiva Kumar 

output panel Component

Hi,

Could   you please explain me the "output panel " component  with simple example.

Regards,
Ram.
TintuBabuTintuBabu
Hi Ram,
In visualforce we often use apex:outputpanel to Conditionally render a section of block of html element using  its render attributes .

for eg,

Suppose we have a variable called role in controller and we need to render a block if role is Admin .We can implement it like this
{!role}
<apex:form >
  <apex:outputPanel id="AdminPanel" rendered="{!IF(role == "Admin",true,false)">
    <apex:outputText value="FirstName:{!name}"/>
  </apex:outputPanel>
​</apex:form >
Ram Shiva KumarRam Shiva Kumar
Hi Tintu,


As of my understand i have written the simple VF code for the out put panel.  here i  want to display the text from right to left and from left to right. so i have used the dir tag.when i run the code , i am getting the same out put for both .my code is as follows,


<apex:page controller="hyd4">
    
<apex:form >
 
 <apex:outputPanel dir="RTL"  Layout="BLOCK" >Hi ALL
 
 </apex:outputPanel> 
  
  
  <apex:outputPanel dir="LTR" LAyout="BLOCK"  >Hi ALL
 
 </apex:outputPanel> 
​</apex:form>
</apex:page>




Please suggest me on this.

Regards,
siva


 
TintuBabuTintuBabu
Hi Ram,

Try this u will understand. No diffrence appered for you is becaues there is no difference in htmll element

<apex:page >
    
<apex:form >
 
 <apex:outputPanel dir="rtl"  >
 <div>123</div>
 <div>sfdsfsf </div>
 
 </apex:outputPanel> 
 
 <apex:outputPanel dir="ltr"  >
 <div>123</div>
 <div>sfdsfsf </div>
 
 </apex:outputPanel> 

The difference is in the screen shot

  User-added image
  
  
​</apex:form>
</apex:page>
 
Ram Shiva KumarRam Shiva Kumar
Hi Tintu,


Yeahh it is working well now. But  when ever weuse the ouput panle we have to use the HTML.....?

and in some codes i have seen that there is no HTML tags while using the output panel....


and wecan use only div and span tags...?


Regards,
Ram.