Question
I'm trying to auto-number forms (editable tables actually) dynamically added to a single topic using
UserCommentsTemplate. I don't know if this is possible, I suspect I may need a plugin like the
AttachContentPlugin. Would like to be sure before i give up on the idea though. Here is the scenario:
I have an 'exception request' form with an editable table and an 'add' button that adds additional, separate editable tables, each representing a specific exception. The first field in each of these tables in the 'Ref' field which I would like to auto-increment with each table added.
I have achieved a count of the forms to determine next Ref value as follows:
%CALC{$SET(sum, 0)}%
%SEARCH{ "\| \*Ref\* \s*\|.*\|" topic="%TOPIC%" nonoise="on" multiple="on" type="regex" format="| 1 | " }%
| %CALC{"$SET(sum, $SUM($ABOVE()))"}% |
I then use
%CALC{"$GET(sum)"}% for the Ref field value in
UserCommentsTemplate. Of course all table references in resulting topic are then rendered as same, last reference calculated. I.e. if there are 4 tables in the topic, Ref no. for all tables is 4.
The first question is therefore...is there a way to retrieve and save the result of a CALC function as opposed to using the original function which recalculates with every refresh? If not, is there another way of doing this without a new plugin and preferably without a separate topic for each table?
Environment
--
MichelleAlbertin - 30 Oct 2007
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.
Sorry, closing this after more than 30 days of inactivity. Please feel free to re-open if needed.
--
PeterThoeny - 03 Dec 2007