untangled 2017-03-31

adding :top-router to (om/transact! comp-or-reconcilerโ€ฆ seems to do the trick.

Do I understand the idea of the forms portion of the untangled-ui library correctly? Basically, a form targets some entity in the app-db, so that values entered into the form component are committed to that entity

We laughed our asses off

So perhaps I'm abusing initialAppState

I have a defui component without render that declares the query, ident and initialAppState for an entity in the app-db

Then there are supposed to be a bunch of other components which are forms that edit entities of this type

Ok... so it was my error that it wasn't working. Called the wrong query. Still, did I stumble upon the correct solution. If I want to initialize an entity in the initial state, that multiple components will render and edit, I declare it's query, ident and initial-state in a defui

then I use them in the components that are supposed to edit this entity

I compose its initial state and query into their initial states and queries. To make it all the same entity, I give the Entity component a default id, so that get-initial-state always yields the same entity, even if called on many components

Yes, the form keeps an alternate state for the entity. When you commit it, it copies it over. It also supports sending the delta remotely

look in the devcards for it...the docs are close to good ๐Ÿ™‚

@mitchelkuijpers @fatihict Glad you guys enjoyed it. If you haven't seen "The Doctor" Kids in the Hall sketch, you should watch it...it's kinda older, and no one got that one at all

Ahhh, now I see. I didn't get that one either, but that's hilarious ๐Ÿ˜ƒ. Also the ending about the cake was cruel ๐Ÿฐ๐Ÿ˜†

@tony.kay The guide cleared up a lot... there's still a question forming, but it isn't quite ready ๐Ÿ™‚

@tony.kay I think there's a small error in the guide.

(f/form-field my-form :name) --- outputs ---> (dom/input #js { ... }) should be

(f/form-field comp my-form :name) --- outputs ---> (dom/input #js { ... })

when calling f/form-field is it possible to specify attributes of the resulting input? For instance, to add a call to commit onBlur? I see that I can pass things like :className to f/text-input in IForm, but is there a way to do it dynamically?

Hm... for some reason commit-to-entity! isn't updating the target entity

Yes, so apparently the entity ended up in the database because the other view in the join query didn't yet implement form. So a component with just a form did not even create the actual entity that the form was supposed to augment. So I must be missing something.

All the examples in the guide some to be such that entity IS the form... so where is it committing if there isn't an unaugmented version of the entity in the app-db?

In my case I have a type of Entity which is a defui that just declared initial-state, query and ident. Then there are a bunch of forms which all edit this entity same entity. However, the entity doesn't end up in the initial state, because it isn't directly used in a Query

So I see why Entity doesn't end up in the database... but what do I do so that it will? started-callback? Entity doesn't really have 1 representation in the ui, but multiple views which edit it.