0

I have multiple VF pages apex/vf_table1, apex/vf_table2 and "apex/vf_table3" in iframes in a single VF page "apex/vf_table". All uses the same save button. How can I override the save method of the vf in iframes to prevent them from going into their respective detail page?

This is in my controller..

 public PageReference save()
 {
   upsert fb;
   PageReference newocp = new PageReference('/apex/vf_table?accId= account.Id');
   return newocp;
  }

This is my VF..

<apex:commandButton action="{!save}" value="Save"/>
3

Is it possible for you to alter the code of the pages in the frames? If they are using the standard save action, you can change them to use the quicksave standard action instead. Unlike the standard save action it does does not redirect after the save.

Here is an example that uses quicksave on an Account standard controller. This is taken from the example on the standard actions documentation page and modified to use quicksave. When the user clicks the Quick Save button the record is saved. Note that there is no method that you have to implement in a controller extension. The standard controller action takes care of the quick save for you.

<apex:page standardController="Account">
  <apex:form>
    <apex:pageBlock title="My Content" mode="edit">
      <apex:pageBlockButtons>
        <apex:commandButton action="{!quicksave}" value="Quick Save"/>
      </apex:pageBlockButtons>
      <apex:pageBlockSection title="My Content Section" columns="2">
        <apex:inputField value="{!account.name}"/>
        <apex:inputField value="{!account.site}"/>
        <apex:inputField value="{!account.type}"/>
        <apex:inputField value="{!account.accountNumber}"/>
      </apex:pageBlockSection>
    </apex:pageBlock>
  </apex:form>
</apex:page>
1
  • Thanks peter. Yes, I wanted exactly like the quicksave feature. But I am unable to find any article on how to use quicksave in a vf. Please help if you have any references.
    – MnZ
    Apr 23 '14 at 1:46
1

May be you can use custom controllers. The overhead would be that you will have to implement your own methods/action like edit delete etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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