Priority: Enhancement
Current State: Confirmed
Released In: n/a
Target Release: n/a
It came as a surprise that there's no way to do this easily:
(pseudo code)
my $topicObj = new Foswiki::Meta($session, $web, "NewTopic", $textWithoutMeta);
$topicObj->addDataForm($web, "SomeForm"); # we've got $topicObj->putKeyed('FORM', "$web.SomeForm") ... maybe that's enuf, but still rather low level
$topicObject->putFormValues(
FieldName1 => $value1,
FieldName2 => $value2,
);
The bits to do that are spread over different places:
- Foswiki::UI::Save holds the code to establish a DataForm within the Meta object
- Foswiki::Form::FieldDefinition holds the code to populate a DataForm with values taken from a $query.
The rest of the code assumes a DataForm is already attached to a topicObj. Creating one
from scratch is not possible as is now.
--
MichaelDaum - 12 Mar 2011