Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Add buffer attribute to disable batching of javascript remoting calls #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion RemoteTK.component
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVE
POSSIBILITY OF SUCH DAMAGE.
-->
<apex:component controller="RemoteTKController">
<apex:attribute name="buffer" type="Boolean" default="true" description="Batch up Remoting calls"/>
<script>
var remotetk = window.remotetk;
var enableBuffer = {!buffer};

if (remotetk === undefined) {
remotetk = {};
Expand Down Expand Up @@ -75,6 +77,7 @@ if (remotetk.Client === undefined) {
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteTKController.describe}', objtype, function(result){
handleResult(result, callback, error);
}, {
buffer: enableBuffer,
escape: false
});
}
Expand All @@ -92,6 +95,7 @@ if (remotetk.Client === undefined) {
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteTKController.create}', objtype, JSON.stringify(fields), function(result){
handleResult(result, callback, error);
}, {
buffer: enableBuffer,
escape: false
});
}
Expand All @@ -109,6 +113,7 @@ if (remotetk.Client === undefined) {
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteTKController.retrieve}', objtype, id, fieldlist, function(result){
handleResult(result, callback, error);
}, {
buffer: enableBuffer,
escape: false
});
}
Expand All @@ -129,7 +134,8 @@ if (remotetk.Client === undefined) {
Visualforce.remoting.Manager.invokeAction('$RemoteAction.RemoteTKController.upser', objtype, externalIdField, externalId, JSON.stringify(fields), function(result){
handleResult(result, callback, error, true);
}, {
escape: false
buffer: enableBuffer,
escape: false
});
}

Expand All @@ -147,6 +153,7 @@ if (remotetk.Client === undefined) {
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteTKController.updat}', objtype, id, JSON.stringify(fields), function(result){
handleResult(result, callback, error, true);
}, {
buffer: enableBuffer,
escape: false
});
}
Expand All @@ -163,6 +170,7 @@ if (remotetk.Client === undefined) {
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteTKController.del}', objtype, id, function(result){
handleResult(result, callback, error, true);
}, {
buffer: enableBuffer,
escape: false
});
}
Expand All @@ -178,6 +186,7 @@ if (remotetk.Client === undefined) {
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteTKController.query}', soql, function(result){
handleResult(result, callback, error);
}, {
buffer: enableBuffer,
escape: false
});
}
Expand All @@ -193,6 +202,7 @@ if (remotetk.Client === undefined) {
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteTKController.search}', sosl, function(result){
handleResult(result, callback, error);
}, {
buffer: enableBuffer,
escape: false
});
}
Expand Down