Link two UIViewFieldSelectField components to the same data source

I have two pages containing a UIViewFieldSelectField component each one.

Scenario:

  • Page 1 contains UIViewFieldSelectField Component1.
  • UIViewFieldSelectField Component1 contains Option1 & Option2.
  • UIViewFieldSelectField Component1 is fed by DataSourceX.
  • Page 2 contains UIViewFieldSelectField Component2.
  • UIViewFieldSelectField Component2 contains Option1 & Option2.
  • UIViewFieldSelectField Component2 is fed by DataSourceX.

I am experiencing the following behavior:

  • On page 1, select Option 1 on UIViewFieldSelectField component1
  • Go to page 2, by means of submenu navigation
  • On page 2, I find UIViewFieldSelectField component2 with Option1 already selected. I select Option2.
  • Go to page 1, by means of submenu navigation
  • On page 2, I find UIViewFieldSelectField component1with Option1 still selected, instead of Option2.

Which is the correct way to make the two selectors always aligned?

The way you currently have the components set up, Component1 and Component2 are unique components with their own local state (e.g., the currently selected option). In order to align the pages, you actually want to render the same component on both pages. Move your UIViewSelectField to a separate .c3ui file so that it becomes a shared component, and then reference that component by its metadata id in each page.

Version: <=7.9