The
TWikiForms definition has an "M" attribute to declare a form fields as manditory. When you create a TWiki forms based TWiki app you typically want to create a template topic with empty fields, but wwant to require users to fill in the details. That is, it should be possible to override the manditory flag
just for the template topic.
Not sure what the best spec is. Possibly treat topics with forms differently if listed in the WEBFORMS preferences settings?
--
TWiki:Main/PeterThoeny
- 10 Feb 2007
Another approach would be to save the template topic with a value for the mandatory field, but
clear that value when the template is instantiated in a new topic. That would avoid having to handle template topics specially when they are being defined.
This is a real problem for twiki application authors, and should be fixed.
CC
The documentation is extremely misleading in this area. When you create a new topic based on a template with an attached form, you should use the
formtemplate
parameter to
save
(see
TWikiScripts).
Changing this to a documentation bug, as it isn't at all clear.
Doc improved, closed.
CC
Re-opening since the actual problem is not resolved. Add developers would like to specify mandatory fields, but still leave the fields empty in the template. A doc only solution is possible if you use an HTML form to create new topics, but it does not work if you want to rely on the
WebTopicEditTemplate (e.g. clicking on a questionmark link.)
--
PTh
Note that the doc is clear that
any value in the form attached to the template topic is carried into the generated topic. That includes mandatory fields. Since you cannot save a topic without filling in mandatory field values, that means you have to do "something special" when a topic template including a mandatory field is instantiated. Every "something special" we add makes the code more complex, and the interface less intuitive. I would prefer to disallow forms on template topics, than add any more cleverness for mandatory fields.
The doc is clear on what you have to do to include mandatory fields, and IMHO we do not need more code to solve this.
If you want to push the point, please open a new report for the enhancement; we need to keep this "Waiting for Release" so we can track it into the release package.
CC
OK, let's follow up with a new item:
Item4261
--
PTh