01.06.2013 Views

OpenEdge Development: Mobile Applications - Product ...

OpenEdge Development: Mobile Applications - Product ...

OpenEdge Development: Mobile Applications - Product ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

JSRecord object<br />

JSRecord object<br />

Properties<br />

Methods<br />

JSRecord is a JavaScript object that returns a record instance for any temp-table stored<br />

in the local storage of an associated progress.data.JSDO class instance (JSDO).<br />

Table 8: JSRecord object properties<br />

Member<br />

Events This object has no events.<br />

Brief description<br />

(See also the reference entry)<br />

data property An object containing the data for a temp-table<br />

record specified by a JSRecord object<br />

Table 9: JSRecord object methods<br />

Member<br />

assign( ) method (JSDO<br />

class)<br />

Brief description<br />

(See also the reference entry)<br />

Updates field values for a temp-table record<br />

specified by a JSRecord object<br />

getId( ) method Returns the unique internal ID for the specified<br />

temp-table record referenced in JSDO local<br />

storage<br />

remove( ) method Deletes the temp-table record specified by a<br />

JSRecord object<br />

Example The following example assumes that a JSDO is referenced by the jsdo variable, and<br />

that a UIHelper instance associated with that JSDO is referenced by the uihelper<br />

variable. The example creates a new record object and displays it, along with a<br />

message with credit information using properties of the record object:<br />

function addRecord() {<br />

var jsrecord = jsdo.add({Balance: 10000, State: 'MA'});<br />

uihelper.display( );<br />

alert('Record ID: ' + jsrecord.getId( ) + ' CreditLimit: ' +<br />

jsrecord.data.CreditLimit);<br />

}<br />

Note Using the add( ), find( ), findById( ), or foreach( ) method, or the record<br />

property, on a given JSDO and table reference, a JSRecord instance returns a working<br />

record for the temp-table referenced in JSDO local storage. You can then use<br />

properties and methods of the JSRecord to update, delete, or display the specified<br />

record from the JSDO.<br />

See also add( ) method, find( ) method, findById( ) method, foreach( ) method,<br />

progress.data.JSDO class, record property, table reference property (JSDO)<br />

154 <strong>OpenEdge</strong> ® <strong>Development</strong>: <strong>Mobile</strong> <strong>Applications</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!