+ Start a Discussion
anup-prakashanup-prakash 

Components and rerendering

Hi what I am trying to attain in my page is that I Have three comandbuttons "New Product", "Add Lot" , "Search Productt"

and when a user clicks on either of the buttons the related set of entities should be displayed.. Instead of re directing the user to a different page I want it to happen on this page itself.. I do not wish to use Iframe.. Is there any way?

 

Best Answer chosen by Admin (Salesforce Developers) 
swatKatswatKat

You can use wrap your related content in a panel and use the rendered property (controlled by a boolean variable). On the button click , call a method to set the boolean variable to true. The rerender property on the button will just regenerate rour related content. Something like this :

  Visualforce Page :

  <apex:outputPanel id="Container">
    <apex:outputPanel id="Panel" rendered="{!isShowPanel}"> 
      	//related content 
    </apex:outputPanel>
  </apex:outputPanel>
  
  <apex:commandButton value="Submit" rerender="Container" action="{!showPanel}"/>



  Apex Class :

  public class example{

	public Boolean isShowPanel { get ; set ;}
	
	public example(){

		isShowPanel =false;
	}
	
	public void showPanel(){
		isShowPanel = true;
	}
  }

 

All Answers

swatKatswatKat

You can use wrap your related content in a panel and use the rendered property (controlled by a boolean variable). On the button click , call a method to set the boolean variable to true. The rerender property on the button will just regenerate rour related content. Something like this :

  Visualforce Page :

  <apex:outputPanel id="Container">
    <apex:outputPanel id="Panel" rendered="{!isShowPanel}"> 
      	//related content 
    </apex:outputPanel>
  </apex:outputPanel>
  
  <apex:commandButton value="Submit" rerender="Container" action="{!showPanel}"/>



  Apex Class :

  public class example{

	public Boolean isShowPanel { get ; set ;}
	
	public example(){

		isShowPanel =false;
	}
	
	public void showPanel(){
		isShowPanel = true;
	}
  }

 

This was selected as the best answer
anup-prakashanup-prakash
Thanks Mann this was what I needed..