Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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 data.how do i accomplish this?

share|improve this question

1 Answer 1

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>   
          <apex:column headerValue="B" >
              <apex:inputField value="{!x.bField}" rendered="{!NOT(flag)}"/>
              <apex:outputField value="{!x.bField}"  rendered="{!flag}"/>
          </apex:column>         
      </apex:pageBlockTable> 

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

share|improve this answer

Your Answer

 
discard

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.