Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating a page.where we search a record based on the given id.the record is displayed along with a edit and save button.The data is displayed onto label.On the click on edit button the label should be changed into textbox prepopulated with the do i accomplish this?

share|improve this question
up vote 3 down vote accepted

you can set boolean flag true in constructor initially.

<apex:pageBlockTable value="{!lstX}" var="x" >         
          <apex:column headerValue="A" >
              <apex:inputField value="{!x.aField}"  rendered="{!NOT(flag)}"/>
              <apex:outputField value="{!x.aField}"  rendered="{!flag}"/>
          <apex:column headerValue="B" >
              <apex:inputField value="{!x.bField}" rendered="{!NOT(flag)}"/>
              <apex:outputField value="{!x.bField}"  rendered="{!flag}"/>

you can set flag true/false accordingly on EDIT/SAVE button method.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.