This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
I have multiple fulcro rad forms on one page. Im also using the router from rad. How can I avoid each rad form changing the url but still use the routing for certain forms?
Use the forms that you do not want to use routers without a router. You will need to start manually the form's state machine via start-form!
which normally https://github.com/fulcrologic/fulcro-rad/blob/cb8e2e99711bd30f55b244748c0e4bd15c70668e/src/main/com/fulcrologic/rad/form.cljc#L389
Yes, I do start them with start-form
.
When I save the form then, they change the url in the browser to their own route.
I guess you call save!
, which triggers :event/save
which then triggers :event/saved
which, as you have observed, https://github.com/fulcrologic/fulcro-rad/blob/cb8e2e99711bd30f55b244748c0e4bd15c70668e/src/main/com/fulcrologic/rad/form.cljc#L1023. The obvious solution is to https://github.com/fulcrologic/fulcro-rad/blob/cb8e2e99711bd30f55b244748c0e4bd15c70668e/src/main/com/fulcrologic/rad/form_options.cljc#L295 for these forms not to do that (look at defstatemachine
, it essentially use def's a map so you can take it and assoc-in your variant of :event/saved). You could also ask @U0CKQ19AQ whether it would make sense to extend the check in :event/saved
from just (when (history/history-support? fulcro-app)
to something like (when (and (history/history-support? fulcro-app) (this form has :route-segment defined)
.
Ah, yeah, so that’s a good note. It would make more sense for there to be an option you could pass on start of the form to indicate if the form was embedded or standalone, then have the UISM pay attn to that for URL manipulation. If you’d like to make a contribution to the RAD library for that, I’d take it.