marvinbleiberg
Posts: 0
Joined: Wed Jan 25, 2012 8:16 pm

Arrays and Grids for data capture by User

I've seen some info on Appery for mapping to an array or grid, for data delivered via REST service.

If I want to use a grid (for display) and array (for internal storage) of data that is captured in real-time with camera and bar code scan (e.g - 3 columns: each row will contain data from a bar code scan event, a photo event, and a user selection from a pre-set list of choices), but the number of rows is variable - how to set this up? Is it "point and click", or do I need to write some sort of loop in javascript?
thank you-
MB

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Arrays and Grids for data capture by User

Hello! If we understand your question correctly, it works automatically.

marvinbleiberg
Posts: 0
Joined: Wed Jan 25, 2012 8:16 pm

Arrays and Grids for data capture by User

So I can set up a grid and an array with only 1 row to start, and a new row will automatically be added to both array and grid, each time the bottom row is filled? Or is a specific event required to add a new row?
thx

marvinbleiberg
Posts: 0
Joined: Wed Jan 25, 2012 8:16 pm

Arrays and Grids for data capture by User

unlike your documentation on mapping a REST webservice response into an array on the device, there is nothing about a grid that indicates it is an array.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Arrays and Grids for data capture by User

"Or is a specific event required to add a new row" - yes
What is array (what do you mean on internal storage)? Is it localStorage, global variable or a record in SQLite table?

marvinbleiberg
Posts: 0
Joined: Wed Jan 25, 2012 8:16 pm

Arrays and Grids for data capture by User

Maryna-
I think I've just figured out that a grid itself does not hold any data. Rather, each cell in the grid contains whatever object (Text Box, Label, Popup, etc.) is placed in that cell - and mapping of data (to/from services is done to the individual object (which happens to reside in a cell inside the grid).

Assuming I understand that correctly, If I have a grid with 3 rows and 5 columns that would be 15 individual values to map from a service, and would require 15 objects to be created. The example in "Home → Documentation → Using a REST service on a page" shows an array being mapped from a service to a "grid", but it shows 2 values being mapped to 2 specific labels inside the grid. So I don't see how that can loop through multiple rows automatically, for an undetermined number of rows, if each destination label must be created and mapped in advance?

Can you advise?
thx-
MB

Return to “Issues”