multiple placements of the same DataField

Former Member
Former Member
I guess this isn't officially supported, as I can't find anything in the docs about it. But my Edge 520 allows me to "place" two or more of the same ConnectIQ DataField on the same page.

A quick check in the simulator shows AppBase.onStart() is only called once, as is AppBase.getInitialView(). But DataField.onLayout() seems to be called at least once for each "placement".

If this is not supported, surely this is "coming soon"? I am aware of the workaround of installing the same app multiple times under different uuids, But I am trying to connect to a custom ANT device that has lots of information available to show. I want to be able to put multiple fields on multiple pages, all of which are accessing this same device over an ANT channel. And no, I don't want to create a widget or an app. I want to see all this info on my main pages.

If a new View object is made for each placement, I think all of my code would just work.

Thanks.
  • Former Member
    Former Member over 7 years ago
    This is allowed on devices. The application is not started multiple times, and will behave similarly to what you see in the simulator with multiple view ports being rendered at the same time.

    Any time a data field placement is rendered that does not have the same layout as the previous render, the onLayout() method will be called to update the application with the layout information. If you have two placements selected that have identical width, height, and obscurity, you will simply see double the amount of calls to onUpdate(). If there is a difference in the width. height, or obscurity, you will see alternating onLayout() and onUpdate() calls as the device alternates rendering the placements. This only applies to Complex Data Fields that render their own view. The compute function, which is used to return data for simple fields is called only once in all scenarios and that data populates all placements.

    The only good way to consistently display multiple data points from a single field is to use a complex field, and render all your data points into the same display context. You can make the amount of data displayed dependent on the size of the display context you receive in onLayout()/onUpdate()
  • Former Member
    Former Member over 7 years ago
    Thanks for the clarification. So if I read the correctly, multiple placements isn't really supported. At least not in a way that makes sense. I have my 520 setup in 10 field mode, so if I put two CIQ fields on that same page, I will get two onUpdate() calls, but I will have no way of knowing which is which. The calls are made on the same object, meaning I can't reliably show different values in different fields. If I used a 7 field display, then I could put one at the top and one at the bottom, and do a hacky detection of the dc size to switch which value I'm rendering. Is that correct? Would you say the given design is an oversight, an intentional decision, something that might be remedied? Thanks again.
  • Former Member
    Former Member over 7 years ago
    I just realized there is no UX/UI support for multiple placements showing different data. On the device anyway. It could easily be configured on the Phone, e.g. first placement shows X, second placement shows Y.
  • Former Member
    Former Member over 7 years ago
    No, multiple placements that display different data is not really supported. Multiple placements on different data screens that display the same data is the use case targeted by the system behavior.
  • Former Member
    Former Member over 7 years ago
    Ok, good to know. Thanks.

    May I ask the rationale behind not allowing ANT burst transfers on a data field? I know it can overload the entire network spectrum, but, you know, user beware.
  • Former Member
    Former Member over 7 years ago
    I don't know the details of that decision, but I think it is pretty much as you stated. Features that could compromise the reliability of native functionality (i.e. native ANT sensor connections) are generally not allowed in data fields.