Multiple Instances of a Data Field

My data field presents content in a different fashion depending on the size of the data field. Assigned to a full screen, it shows everything. Assigned to a field less than the full screen (say, to a small full-width field shown under the map view), it shows a subset of the data, alternating between a set of views.

Many like to run this data field on both screens - a full-screen view, and when they swipe to track the turn-by-turn map, they like the smaller view.

When this happens, I've assumed the data field is running a single instance that adapts to the layout that is currently active. Not two distinct instances. Just asking to make sure. Thanks!

  • When this happens, I've assumed the data field is running a single instance that adapts to the layout that is currently active. Not two distinct instances. Just asking to make sure. Thanks!

    I'm fairly sure this is the case (it matches my recollection and otherwise it seems you could circumvent the 2 CIQ fields limit), but you could verify this by creating a small test data field which displays a counter that increments whenever onShow() is called. Flip between the 2 pages which contain your field and you have your answer.

  • I'd use onLayout() instead of onShow(), and maybe even have the two copies on the same data screen as a start.  compute() should only be called once, but onLayout() and onUpdate() for each data field.  You see this in the sim when you use a layout of more than one DF.