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.

fill( ) method<br />

fill( ) method<br />

Initializes the JSDO local storage from the data records in a single temp-table, or in one<br />

or more temp-tables of a ProDataSet, as returned by the built-in read operation of the<br />

<strong>Mobile</strong> resource for which the JSDO is created. This built-in operation is the single<br />

resource operation that is annotated in the <strong>Mobile</strong> interface with the "read" operation<br />

type. The result of calling this method replaces any prior data in JSDO local storage<br />

with the records returned by the built-in read operation.<br />

After completing execution, the working record for each referenced temp-table is set to<br />

its first record, depending on any active parent-child relationships. So, for each child<br />

temp-table, the first record is determined by its relationship to the related working<br />

record in its parent temp-table.<br />

Return type: null<br />

Applies to: progress.data.JSDO class<br />

Syntax<br />

fill ( [ filter-string ] )<br />

filter-string<br />

A string that can be used on the AppServer to select records to be returned, much<br />

like the WHERE option of the ABL record phrase. The actual format of this string and<br />

its affect on the records returned is determined by the ABL routine on the<br />

AppServer that uses it. For example, you might pass:<br />

• A single key value (e.g., "30")<br />

• A relational expression (e.g., "CustNum > 10 AND CustNum < 30")<br />

• An actual WHERE string (e.g., 'Item.CatDescription CONTAINS "ski &<br />

(gog* ! pol*)"')<br />

Note: The JSDO requires the URI for the "read" operation of the resource to<br />

contain the following query string: "?filter=~{filter~}", where filter<br />

is the name of a string input parameter defined for the ABL routine that<br />

implements the operation (INPUT filter AS CHARACTER).<br />

Caution: Using an actual WHERE string for a dynamic ABL query can create a<br />

potential security issue.<br />

If you do not specify filter-string, the records returned, again, depend on the<br />

ABL routine.<br />

This method always executes asynchronously, and fires the following JSDO named<br />

events, shown in operational order:<br />

1. beforeFill event<br />

2. afterFill event<br />

208 <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!