Fork me on GitHub
#fulcro
<
2022-10-29
>
roklenarcic11:10:02

How do I tell form system, that I just want a picker for a ref attribute? I keep getting warnings:

Reference attribute :.....model-rad.category/parent in form has no subform information and no field style/target id key.
But the attribute has ao/style :pick-one and ao/target ::id. I also get errors:
Subforms for class ….ui.category/CategoryForm must include a ::form/ui entry for :….model-rad.category/parent
When I am using a picker what is the ::form/ui entry? I am not using my own class to render, I am using the prebuilt picker…

roklenarcic11:10:39

com.fulcrologic.rad.form:336
expects style to be defined on form in field-styles if style is defined on the attribute itself the warning triggers… seems not correct

roklenarcic18:10:32

To answer my own problem, looks like putting ao/style on attribute is not good, it is required to put fo/field-styles entry for each ref that’s not a subform.

greg14:10:49

Hi, I'm trying to follow up series of tutorials that Tony Key published on YT, and execute exactly the same code as he does locally on my machine. In the second video about data normalization Tony resets internal state atom (`(::app/state-atom APP)`) and based what I see the atom value survives shadow updates. On my machine locally, every time when shadow updates browser it clears out the value I set for that atom - every time shadow updates the browser, it re-renders the tree with root value nil. Initially I used the latest version of the libraries, but even with the exactly same versions he uses, I still have the same behaviour. I'm pretty sure I setup the project the same as he shows, so not sure where this difference comes from. It feels like there is something obvious that I'm missing in my setup. Any ideas?

1
greg14:10:10

I found the problem. The initial files I wrote based on the Tony's first video showing all the edns and code from terminal. In these files he had APP as a def, while later in the IDE he had defonce. I didn't spot it. So the app with it is state was recreated on every shadow refresh

(def APP (app/fulcro-app))
and with change to
(defonce APP (app/fulcro-app))
it solved my problem