How to Limit Instances of Datafield on a Layout?

Hi,

when I have two displays of a datafield in a complex layout layout, I get one call to onCompute per second and one to each onUpdate - all as expected

but I want to limit the user to one! … for a small datafield I can say “too small” but my problem use case is the split screen on watch or Edge with 2 valid sized fields

because I do a web request based on the dc size and obscurity in onCompute every X minutes

i could initialise the web request in onUpdate and not onCompute but I’d not know which request of multiple came back for which dc layout

so overall I was hoping there was some setting I had missed to limit the datafield to one user layout

 - thanks for ideas - Crisp

  • I don't have an answer to your question about how to distinguish between two identical data fields on a screen - but that's not necessary (at least in my experience with Edge devices):

    Two identical data fields on a screen behave in exactly the same way (so there is no point in having two on one screen).

    Example: If you tap one to change a display (if the data field offers this option), both data fields respond to this tap in the same way.

    Both data fields behave in exactly the same way. In fact, only one data field is used - it is simply displayed twice.

  • While I think it's impossible to differentiate between 2 fields of the same size and obscurity flag, the behavior you describe is not necessarily a feature of the CIQ platform. I think * it is probably just as much determined by the way your DataField is programmed.

    *) I don't have experience with user interaction (aka touch) with datafields.

    BTW I wasted some time in the past trying to crack this thing (with not much success) and you can try out this DF Detector DataField: https://apps.garmin.com/apps/1535a238-cbac-463b-bde2-373403502a6f also on GitHub: https://github.com/flocsy/DFDetector

  • I think * it is probably just as much determined by the way your DataField is programmed.

    When the program does any stuff coded in onCompute it has effect on all datafields (of the same datafield) on the same screen - even the sizes are different.

    When you do stuff in onUpdate for different datafield sizes, you can get different displays of the datafield at the same time on one screen.

    But 2 identical datafields (same width, same heigth) always react as one in the same way. (What‘s logical, because you cannot distinguish in onUpdate.)

    PS: I have your datafield for field-distinguishing. But as you stated - it does not help - especially with Edge devices.

  • Thanks both -- the DF Detector was really useful in identifying potential problems with watches returning similar or same obscurity flags and sizes, ... and I was OK with the duplication on Edge where two large fields are still rectangular.  My edge-case is where a semi-circular field upper on a watch I would like to process differently to a lower semi-circular layout.

    I could detect two onUpdate() being called with at the same moment and tell one not to update member variables (obscurity) for the onConpute to handle but it was unreliable.  I'll have to give some credit to user common sense (ahahahaahha)

  • assuming you have control of the api server end, just cache the response for x minutes based on a common url pattern that both fields would have.   that way the user can run it in as many fields as they want, but each one will get the same response from your server, one will just get the cached value from the previous call.