Tags:
create new tag
, view all tags

Question

I'm looking for a way to reset a set of values in an edittable. The table is used to track a set of daily system checks our team needs to perform.

I'm using an edittable, with a 'complete' or 'not complete' select list for each task (would have preferred a radio button, but cannot get it to deafult to 'not complete' consistently if anyone has an idea there). At the start of each day, I'd like users to have a button to reset these values to 'not complete' for the new day.

I can use a comment template to get a new table added with default 'not complete' values, but the old table is still there. Can someone suggest a way to delete the old comment (table) and reaplce it with a new one? There is the 'comment_remove' non-standard CommentPlugin attribute but I haven't quite worked out if that does what I hope it to and how to use it. Any examples appreciated.

Alternatively, how can I delete the entire topic and replace with a like-named topic with a fresh table?

Thanks!

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: RHEL3 01, kernel 2.4.21
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Plugins

-- MichelleAlbertin - 28 Jan 2008

Answer

ALERT! 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.

Interesting idea. I guess you could do this easily if the editable table is a form. With some more wizardry you possibly could do this with EditRowPlugin (if you're able to somehow get the correct row number(s)). I don't think you can do this with the standard EditTablePlugin at the moment.

Can you (please) add a sample table here to illustrate the process you need? Maybe I didn't understand your question correctly.

-- FranzJosefGigler - 28 Jan 2008

Since my original post, I've found a solution to fit my needs using the field name for the edit window which I found from viewing source of my topic in edit view. I created a comment template and simply set the value of the edit window field to the %COMMENT% var. Here are details:

2 topics used:

G100OracleDailyChecks: This topic started with one line and is updated via the comment template:

%COMMENT{type="g100_checks"}%

UserCommentsTemplate:

%TMPL:DEF{PROMPT:g100_checks}%
<input type="submit" class="twikiSubmit" value="Reset Form" />
<input type="hidden" name="text" value="%COMMENT{type=g100_checks}%" />
<input type="hidden" name="current_date" value="%DATE%" /> %BR%%BR%
%TMPL:END%
%TMPL:DEF{OUTPUT:g100_checks}%%POS:BOTTOM%
<form name="newDoc" action="%SCRIPTURLPATH{save}%/%WEB%/G100OracleDailyChecks" method="post">
<input type="hidden" name="onlywikiname" value="on" />
<input type="hidden" name="onlynewtopic" value="off" />
</form>
<font size="+2">
Daily checks for: %URLPARAM{"current_date"}%
</font>%BR%%BR%
%EDITTABLE{ format="| row, -1, | label, 20 | label, 15 | label, 4x25 | radio, 2, Not Complete, Complete | " changerows="off" }% 
| *ID* | *Check* | *Area* | *Details* | *Complete* |
| 1 | Check 1 | All | Check details... | Not Complete |
| 2 | Check 2 | App 2 | Check details... | Not Complete |
| 3 | Check 3 | App 1| Check details... | Not Complete |
| 4 | Check 4 | All | Check details... | Not Complete |
%TMPL:END%

What I still need: A way to easily add tasks to the task table without going through the comment template. I tried to put the edittable with all tasks in a separate topic and include that topic in the comment template, but when the table is edited, it is saved in the included topic, not the topic including the list. I also tried using the 'include' attribute from the EditTablePlugin, in the comment template as follows:

%EDITTABLE{include="G100OracleDailyChecksChecklist"}%

with G100OracleDailyChecksChecklist containing task list within it's own edittable definition. This did not work, I got an empty table with one radio button. Perhaps I am using this in the wrong way? Still playing with it.

-- MichelleAlbertin - 28 Jan 2008

Ok, it's clear why

%EDITTABLE{include="G100OracleDailyChecksChecklist"}%
doesn't work - this only includes the EDITTABLE definition, not the table itself. So still need a way to separate the task list from the comment template.

-- MichelleAlbertin - 28 Jan 2008

Final Update: I managed to separate task list from UserCommentsTemplate by creating a third topic called G100OracleDailyChecksTemplate, adding the g100_checks comment definition and including following line in UserCommentsTemplates:

%TMPL:INCLUDE{"G100OracleDailyChecks"}% 

Not ideal, would preferred to have a task table on it's own, but at least this way I've isolated the table from other comment defs eliminating risk of a user breaking something there. See CommentPlugin for more info on template customization.

-- MichelleAlbertin - 28 Jan 2008

 
Change status to:
Topic revision: r6 - 2009-04-22 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.