Skip to main content
added 59 characters in body
Source Link
Patlatus
  • 17.8k
  • 13
  • 82
  • 191

Please try the following way:

<apex:actionFunction name="quickSaveJavascript" action="{!quicksave}" oncomplete="window.top.close();"/>
<apex:commandButton value="Save" onclick="quickSaveJavascript();"/>

=====================

If the above doesn't work, another option is to use Visualforce Remoting, but for that you need custom controller

In javascript, call Visualforce Remoting

CustomController.save(
   records,
   function () {
       window.top.close();
   }
)

If my answer works for you, please mark it as accepted.

Please try the following way:

<apex:actionFunction name="quickSaveJavascript" action="{!quicksave}" oncomplete="window.top.close();"/>
<apex:commandButton value="Save" onclick="quickSaveJavascript();"/>

=====================

If the above doesn't work, another option is to use Visualforce Remoting, but for that you need custom controller

In javascript, call Visualforce Remoting

CustomController.save(
   records,
   function () {
       window.top.close();
   }
)

Please try the following way:

<apex:actionFunction name="quickSaveJavascript" action="{!quicksave}" oncomplete="window.top.close();"/>
<apex:commandButton value="Save" onclick="quickSaveJavascript();"/>

=====================

If the above doesn't work, another option is to use Visualforce Remoting, but for that you need custom controller

In javascript, call Visualforce Remoting

CustomController.save(
   records,
   function () {
       window.top.close();
   }
)

If my answer works for you, please mark it as accepted.

added 304 characters in body
Source Link
Patlatus
  • 17.8k
  • 13
  • 82
  • 191

Please try the following way:

<apex:actionFunction name="quickSaveJavascript" action="{!quicksave}" oncomplete="window.top.close();"/>
<apex:commandButton value="Save" onclick="quickSaveJavascript();;"/>

=====================

If the above doesn't work, another option is to use Visualforce Remoting, but for that you need custom controller

In javascript, call Visualforce Remoting

CustomController.save(
   records,
   function () {
       window.top.close()"/>;
   }
)

Please try the following way:

<apex:actionFunction name="quickSaveJavascript" action="{!quicksave}"/>
<apex:commandButton value="Save" onclick="quickSaveJavascript(); window.top.close()"/>

Please try the following way:

<apex:actionFunction name="quickSaveJavascript" action="{!quicksave}" oncomplete="window.top.close();"/>
<apex:commandButton value="Save" onclick="quickSaveJavascript();"/>

=====================

If the above doesn't work, another option is to use Visualforce Remoting, but for that you need custom controller

In javascript, call Visualforce Remoting

CustomController.save(
   records,
   function () {
       window.top.close();
   }
)
Source Link
Patlatus
  • 17.8k
  • 13
  • 82
  • 191

Please try the following way:

<apex:actionFunction name="quickSaveJavascript" action="{!quicksave}"/>
<apex:commandButton value="Save" onclick="quickSaveJavascript(); window.top.close()"/>