Fork me on GitHub
#fulcro
<
2021-10-28
>
cjmurphy04:10:19

With RAD I'm wanting to transact a local mutation when the user changes the value on a :select-one picker. I was hoping there might be a hook for this (say ::picker-options/selectedAValue) but there isn't. I suppose the 'RAD way' would be to have a ro/row-actions - so a button on each row. But this would be confusing for the user as the button action would be a repeat of the intention.

Jakub Holý (HolyJak)08:10:26

Where do you have the picker? Is it a report action? Are we at all speaking about a report or about a form? I believe a report can only have a picker as either a report or row action?! If you speak about a form then it fires form/input-changed! which triggers :event/attribute-changed - you can modify the UISM to trigger the additional mutation.

cjmurphy08:10:30

The picker is on a form, used to change the value of an attribute.

cjmurphy09:10:48

It does seem that a RAD form can have fo/triggers that then has an :on-change key. I'm looking at LineItemForm in the RAD demo. Using an on-change trigger might be a bit more convenient than modifying the form state machine.

❤️ 1
cjmurphy09:10:05

Good to see an example of modifying a state machine in the latest RAD demo (`master-detail-report-machine` - extending a forms machine will be the same as extending a reports state machine as done there). I'm sure I'll be needing to do that soon enough...

Jakub Holý (HolyJak)09:10:33

Ah, I was confused by your mention of report-options...

cjmurphy10:10:40

Yeah sorry I'll cross that out. Was irrelevant to the question and plain wrong anyway. Some kind of action button doesn't even make sense as a replacement for an onChange.

tony.kay16:10:43

Triggers is probably the answer in this case. The other option is to install your own control "style" for that kind of control and allow it to take extra props/options. The final option is to just take control of the rendering of the form and do exactly what you want, while still having RAD support for form data.

cjmurphy23:10:30

That did occur to me as well. RAD starting to look like Oracle Forms - a good thing - a development environment that also had an 'ON-CHANGE TRIGGER'.

tony.kay01:10:06

I'm not sure I like the comparison 😛 RAD isn't meant to be a bells-and-whistle kind of thing. It's meant to give you a fast way to stand something up for alpha/early stage, and escape to hand-written stuff easily and gradually as needed. So, while the feature set I'm supplying might satisfy a large chunk of "easy needs", I see the entire architecture as completely different.

😆 1