My application contain big form with 18 fields. It is processed with standard form mapping, like this:
val bigForm = Form(
mapping(
"id" -> of[ObjectId],
"title" -> text,
// And another 16 fields...
...
)
)
And all was well, but today I decided to add one more field and here comes the problem – mapping is not able to take more than 18 arguments.
What should I do then? I thinking of combining some fields into the structure, but additional structure requires additional formatter, JSON serializer and deserializer, too much work. I’m looking for a general solution, more fields are likely to appear in the future.
Another solution I’m thinking about is to handle form manually, without Form‘s.
Are there better solutions?
You can use nested mappings, e.g.