Fork me on GitHub
#om-next
<
2016-09-18
>
mitchelkuijpers07:09:32

Aha are there multiple instances of RoundDropDown ?

joseph09:09:31

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

mitchelkuijpers09:09:17

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

mitchelkuijpers09:09:58

My actual question is: what is your root query?

joseph10:09:41

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

joseph10:09:02

here is the tree components:

joseph10:09:25

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

joseph10:09:23

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

joseph10:09:38

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

joseph10:09:15

the sidebar contains multiple components which includes RoundDropDown:

joseph10:09:27

(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)}])
 ...)

joseph10:09:05

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

mitchelkuijpers15:09:55

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

joseph17:09:14

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

joseph17:09:43

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

joseph19:09:13

@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?