ihp
ihp copied to clipboard
Add field functions for multi-records forms
Working with multi-record forms is a bit tedious. It's either stick with the defaults (e.g. single-record forms) or write everything by hand.
I would like to propose a middle ground with a set of functions for form fields that accept a record as an argument. It will make writing multi-record forms less verbose and more DRY.
The way I see this would be by adding functions for all existing field variants but with a For suffix, for example:
{textFieldFor page #title}{numberFieldFor product #quantity}{selectFieldFor portfolio #projectId allProjects}- ...
Just ran into a situation where this is exactly what I could use as well.
There's a prototype of this in the ihp-multi-records-form-example repo https://github.com/digitallyinduced/ihp-multi-records-form-example/blob/main/Web/View/Tasks/New.hs It requires latest master IHP. If you check out that repo you can give it a try :)
I just saw that. Will check it out. Thanks!