Tags:
create new tag
view all tags

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

TWiki version: TWikiRelease04x01x02
Server OS: RHEL3 01, kernel 2.4.21
Perl version: 5.8
Categories: Plugins

-- MichelleAlbertin - 30 Oct 2007

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is 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

Change status to:
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2007-12-03 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.