Question
I want to create a form to contain data relating to a project. I would like the form to contain also a button for creating topics relating to releases, along with a list of existing release topics (this would be a formatted search).
When the release form appears, certain fields (e.g. project name, description)should be populated from the parent form.
How do I go about achieving this?
Environment
--
RalphEllison - 29 Dec 2006
Answer
If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.
I'm assuming you're comfortable in designing html forms. Let's further assume that you'll design an html form for creating the new topics and INCLUDE this into the topic you want to pull the TWikiForm values from. (I'll discuss other options after outlining the basic idea of how to make this work.)
To populate the html form elements with the TWikiForm values, you'd use a syntax something like this:
<input type="hidden" name="Project" value="%FORMFIELD{\"ProjectName\" topic=\"%BASEWEB%.%BASETOPIC%\" }%" />
Another slightly different approach would be to have a button on the parent topic that leads one to the html form. The botton would include a URLPARAM called something like
parentProject. Then, in the form, you would have elements similar to above, only you'd replace
%BASEWEB%.%BASETOPIC% with
%URLPARAM{"parentProject"}%.
Hope this helps!
--
LynnwoodBrown - 29 Dec 2006
I can't get this to work.
On the parent Project topic, I have a New Release button, part of a form element that includes the field (
ProjectType)to be propagated to the child topic. When the parent Project topic is rendered and I click the New Release button, a new Release topic opens up and on the address line, the URL includes the ProjectType=AB, as expected. The new Release topic is based on a template that contains the Release
twiki form. This form contains several field definitions, one of which is:
| ProjectType | text| 2 | | bla bla |
This is the field I want to inherit from the parent Project form, however, it renders as empty...
I must be missing something.
Perhaps there is there a howto or sample app that demonstrates this feature?
--
RalphEllison - 02 Jan 2007
Got this working by entering URLPARAM{ProjectType} of the value field in the form template.
thanks Lynnwood
--
RalphEllison - 02 Jan 2007