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
Sandy singhSandy singh 

add left panel with command link inside visualforce page

Hi,

 

I have one visualforce page and in this page i want to add left panel, on this panel i want to create command link.

So, can anyone give some idea on this.

 

Thanks in advance,

Sandy

Shebin-KVP Business SolnsShebin-KVP Business Solns

Hi sandy,

 

   Hope you dont mind  left panel made by <apex:outputPanel /  html <div> tag . I a have a  simple solution for you which is using Html <DIV> tag ,if you use <apex:outputPanel> it will be little more difficult to make left box/panel. Here is the visual force markup;

 

    

<apex:page sidebar="false" showHeader="false" controller="MyTestController">
        <apex:form >     
              <div style="width:150px;height:600px;border:solid 1px red;background-color:#C0C0C0;float:left">
                  <apex:commandLink action="{!clickme}" value="Click Me"/>
              </div>
              <apex:outputPanel style="width:150px;border:solid 1px red;float:left;background-color:#707070">
                 <apex:outputText style="color:white" value="{!clicked}"/>
             </apex:outputPanel>
        </apex:form>
   </apex:page>

 

Here  is the apex class to process the Click Me  link .

 

public class MyTestController
{ 
  Public String clicked{get; set;}
  
  public MyTestController()
  {
    clicked='Yo have not Clicked';
   
  }

  public Pagereference clickme()
  {
    clicked='Yes Yo have Clicked the Apex Command Link !!';
    
    return null;
  }

}

 

  While the page loads the constructor  MyTestController()  will load and set the Clicked string  variable to not clicked.The method clickme() is executed when you click the click me link. In the clickme() method you will set  Clicked string    variable  as  'Yes Yo have Clicked the Apex Command Link !!'.  This is chemestry of apex class and visual force page.

 

Hope you understood ..

 

Feel free  for further clarification.