om-next

mitchelkuijpers 2016-09-18T07:22:32.000128Z

Aha are there multiple instances of RoundDropDown ?

joseph 2016-09-18T09:00:31.000129Z

no, just one, and there are other components using :update-sidebar-dropdown

mitchelkuijpers 2016-09-18T09:53:17.000130Z

which key does :update-sidebar-dropdown live under?

mitchelkuijpers 2016-09-18T09:54:58.000131Z

My actual question is: what is your root query?

joseph 2016-09-18T10:30:41.000132Z

the root query, actually, the rootview node is composed by the tree components

joseph 2016-09-18T10:31:02.000133Z

here is the tree components:

joseph 2016-09-18T10:31:25.000134Z

(defui RootView
  static om/IQuery
  (query
   [_]
   [ :update-form :header :report :session :selected-tab])
  ...)

joseph 2016-09-18T10:32:23.000135Z

the root contains the update-form and report, then update-form contains content and sidebar:

joseph 2016-09-18T10:32:38.000136Z

(defui UpdateForm
  static om/IQuery
  (query
   [_]
   {:update-form/sidebar (om/get-query sidebar/Sidebar)
    :update-form/content (om/get-query FormContent)})
 ...)

joseph 2016-09-18T10:34:15.000137Z

the sidebar contains multiple components which includes RoundDropDown:

joseph 2016-09-18T10:34:27.000138Z

(defui Sidebar
  static om/IQuery
  (query
   [_]
   [:selected-round
    :loading
    :section-responsible
    {:roundDropdown (om/get-query RoundDropDown)
     :countryDropdown (om/get-query CountryDropDown)
     :sectionResponsibleDropdown (om/get-query SectionResponsibleDropDown)
     :sectionResponsibleList (om/get-query SectionResponsibleList)}])
 ...)

joseph 2016-09-18T10:35:05.000139Z

RoundDropDown, CountryDropDown and SectionResponsibleDropDown need to use the :update-sidebar-dropdown

mitchelkuijpers 2016-09-18T15:24:55.000140Z

Your rootview is missing the query and all queries should compose to root so this cannot work correctly

joseph 2016-09-18T17:02:14.000141Z

what do you mean? should I pass all the children components' queries to the rootview?

joseph 2016-09-18T17:09:43.000142Z

then pass the queries' values to its child components? how can it be done?

joseph 2016-09-18T19:19:13.000143Z

@mitchelkuijpers thanks for your suggestion, I solved the problem by adding the query in the rootview to transact!, but I do not understand to update all the related components, why must the query be in the rootview?