Page tree
Skip to end of metadata
Go to start of metadata

This API is synonymous to the pui.submit() API.

Example:

The following demonstrates how to synchronize offline mobile order data with the server.  It can be attached to the onload event of an order entry screen.

function sync() {
  var orders = localStorage["orders"];
  if (orders == null || orders == "") return;
  else orders = JSON.parse(orders);
  if (orders.length == 0) return;
  var order = orders.splice(0,1)[0];
  pui.submitResponse(order);
  localStorage["orders"] = JSON.stringify(orders);
  if (orders.length == 0) {
    alert("Locally stored orders successfully submitted to server.");
  }
}