TWiki
>
TWiki/ Web
>
EditHiddenTablePlugin
(revision 1) (raw view)
Edit
Attach
---+!! %TOPIC% This plugin allows you to edit TWiki tables row by row, using a form with appropriate controls for each field. If preceeded by an =%<nop>EDITHIDDENTABLE{...}%= variable, tables have edit links for each row, and are optionally followed by an *[ Edit table ]* button. Multiple tables per topic are editable, but only one row at a time can be edited. This plugin works exactly like TWiki:Plugins.EditTablerowPlugin, but the tables are stored in meta data and, therefore, not visible or editable in topic text. That is useful in TWiki.TWikiApplications, that want to keep the tables in templates. %TOC% ---++ Acknowledgment This plugin was inspired and steals much from TWiki:Main/PeterThoeny's TWiki:Plugins/EditTablePlugin and tries be compatible with respect to the options and parameters it provides. However, as it supports editing of the table one row at a time, it is not subject to the performance limitations of TWiki:Plugins/EditTablePlugin when faced with large tables. The idea and first implementation of form-based editing for tables goes back to TWiki:Main/ShawnBradford's approach in TWiki:Codev/SimpleTableEntryUsingForms. ---++ Template Before you can edit a table, you need to define a template that describes the layout of the table in the style of TWiki.TWikiForms. The table format is given by a table in the form template: each row defines a table column by giving a field name, field type, size, and initial values, if any. The field type determines how the table row is edited (e.g., as text, textare, radio, checkbox, etc.). For ease of transition of existing systems, the table schema can also be defined in the syntax of TWiki.EditTablePlugin. ---++ Per Table Settings Add a =%<nop>EDITHIDDENTABLE{...}%= variable just before an existing table to make it editable, or add the variable anywhere in a topic to start a new table. Parameters: | *Parameter* | *Comment* | *Default* | | =template= | Topic which defines the format of the table, in the style of TWiki.TWikiForms. The table format is given by one row per table column defining field name, field type, size, and initial values, if any. | | | =header= | Must be used when the table schema is defined in the syntax of TWiki.EditTablePlugin (see documentation there). | | | =format= | Must be used when the table schema is defined in the syntax of TWiki.EditTablePlugin (see documentation there). | | | =changerows= | Rows can be added and removed if ="on"=; rows can be added but not removed if ="add"=. | =CHANGEROWS= Plugin setting | | =helptopic= | Topic name containing help text shown below the table when editing a table. The %<nop>STARTINCLUDE% and %<nop>STOPINCLUDE% variables can be used in the topic to specify what is shown. | (no help text) | | =headerislabel= | Table header cells are read-only (labels) if ="on"=; header cells can be edited if ="off"= or ="0"= | ="on"= | | =editbutton= | Set edit button text, e.g. ="Edit this table"=; set button image with alt text, e.g. ="Edit table, %<nop>PUBURL%/%<nop>TWIKIWEB%/TWikiDocGraphics/edittopic.gif"= | =EDITBUTTON= Plugin setting | | =editlink= | Set appearance of the per-row link, e.g. ="Edit"=; set button image with alt text, e.g. ="Edit table, %<nop>PUBURL%/%<nop>TWIKIWEB%/TWikiDocGraphics/edittopic.gif"= | =EDITLINK= Plugin setting | | =show= | When editing a row of a table, or adding to a table, display that table during edit. | ="off"= | | =headeronempty= | Show the table headers when no rows for this table have yet been defined but the =%<nop>EDITTABLEROW{...}%= tag is present. | ="off"= | The =template= and =format= attributes are mutually exclusive. If the =template= tag is present, the indicated template is used to define the table schema. %X% The TWiki.EditTablePlugin compatability mode is not yet supported. ---+++ Initial Values Table cells are given initial values taken from the template, when a table row is added. ---+++ Supported Field Type All field types supported in TWiki.TWikiForms are supported for table fields also. For example, in the screenshot below, the [[http://dynarch.com/mishoo/calendar.epl][Mishoo DHTML calendar]] is used to select the value for a date field. |<img src="%ATTACHURLPATH%/editwithcalendar.jpg" alt="Edit Table Calendar Example" />| ---++ Table editing A table row can be edited by clicking the link at the beginning of that row. This link may be represented either as * the first table field in the row being a link, * a text link (in smaller font) preceding the first table field, or * an icon preceding the table field, depending on the =EDITLINK= preference setting (see below). In edit mode, the following action buttons are available <form> * <input type="submit" name="etsave" value="Update" onclick="return(false);" /> - saves the table row with the form values * <input type="submit" name="etqsave" value="Delete" onclick="return(false);" /> - delete the selected table row and save (if enabled) * <input type="submit" name="etaddrow" value="Copy" onclick="return(false);" /> - insert a new row into the table after the selected row, taking its values from the form (if enabled) </form> If enabled, below the table a link is shown that allows adding rows to the end of the table. The appearance of this link is controlled by the =EDITBUTTON= preference setting (see below). In add mode, the following action button is available <form> * <input type="submit" name="etdelrow" value="Add" onclick="return(false);" /> - Add row at end of table, taking its values from the form (if enabled) </form> After editing, the focus is moved to the row edited, to avoid excessive scrolling when working with large tables. ---++ Examples Line before table: =%<nop>EDITHIDDENTABLE{ template="..." changerows="on" }%= <table border="1" cellspacing="1" cellpadding="0"> <tr><th class="twikiFirstCol" bgcolor="#99CCCC"><a href="%SCRIPTURLPATH%/oops/Test/TableRowOne?template=oopspreview" title="Sort by this column"> Nr</a> </th><th bgcolor="#99CCCC"><a href="%SCRIPTURLPATH%/oops/Test/TableRowOne?template=oopspreview" title="Sort by this column"> Text field</a> </th><th bgcolor="#99CCCC"><a href="%SCRIPTURLPATH%/oops/Test/TableRowOne?template=oopspreview" title="Sort by this column"> Drop down</a> </th><th bgcolor="#99CCCC"><a href="%SCRIPTURLPATH%/oops/Test/TableRowOne?template=oopspreview" title="Sort by this column"> Mood</a> </th><th bgcolor="#99CCCC"><a href="%SCRIPTURLPATH%/oops/Test/TableRowOne?template=oopspreview" title="Sort by this column"> Timestamp</a> </th></tr> <tr><td class="twikiFirstCol" bgcolor="#FFFFFF"> <a href="%SCRIPTURLPATH%/oops/Test/TableRowOne?template=oopspreview">1</a> </td><td bgcolor="#FFFFFF"> hello table </td><td bgcolor="#FFFFFF"> one </td><td bgcolor="#FFFFFF"> <img src="%PUBURLPATH%/TWiki/SmiliesPlugin/smile.gif" alt="smile" title="smile" border="0" /> </td><td bgcolor="#FFFFFF"> 19 Mar 2005 23:21 </td></tr> <tr><td class="twikiFirstCol" bgcolor="#FFFFCC"> <a href="%SCRIPTURLPATH%/oops/Test/TableRowOne?template=oopspreview">2</a> </td><td bgcolor="#FFFFCC"> </td><td bgcolor="#FFFFCC"> two </td><td bgcolor="#FFFFCC"> <img src="%PUBURLPATH%/TWiki/SmiliesPlugin/frown.gif" alt="frown" title="frown" border="0" /> </td><td bgcolor="#FFFFCC"> 19 Mar 2005 11:21 </td></tr> </table> <form action="%SCRIPTURLPATH%/oops/Test/TableRowOne"> <input type="image" src="%PUBURLPATH%/TWiki/EditTablePlugin/edittable.gif" alt="Edit this table" onclick="return(false);" /></form> If you click on one of the links in the first column, say for the second row, you will be able to edit that table row in a form: |<img src="%ATTACHURLPATH%/edit_ex2.jpg" alt="Edit Table Calendar Example" />| ---++ Plugin Settings Plugin settings are stored as preferences variables. To reference a plugin setting write ==%<nop><plugin>_<setting>%==, for example, ==%<nop>EDITHIDDENTABLE_SHORTDESCRIPTION%== * One line description, shown in the %TWIKIWEB%.TextFormattingRules topic: * Set SHORTDESCRIPTION = Edit TWiki tables rows using a form * Set DEBUG to 1 to get debug messages in =data/debug.txt=. Default: =0= * Set DEBUG = 0 * Default for change rows flag: =on=, =off=, =add= * Set CHANGEROWS = on * Default edit button: Specify =button text=, or specify =alternate text, image URL= * Set EDITBUTTON = Edit table * #Set EDITBUTTON = Edit this table, %PUBURL%/TWiki/EditTablePlugin/edittable.gif * Default edit link for row: Specify =button text=, or specify =alternate text, image URL=. If empty, create link from first field. * #Set EDITLINK = Edit * #Set EDITLINK = Edit, %PUBURL%/TWiki/TWikiDocGraphics/edittopic.gif ---++ Limitations and Known Issues * This Plugin does not (yet) support TWiki table formatting like Multi-span cells (e.g. =| ... ||=) * You cannot put two =%<nop>EDITTABLE{}%= statements on the same line in the source ---++ Plugin Installation Instructions __Note:__ You do not need to install anything on the browser to use this Plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running. * Download the ZIP file from the Plugin web (see below) * Unzip ==%TOPIC%.zip== in your twiki installation directory. Content: | *File:* | *Description:* | | ==data/TWiki/%TOPIC%.txt== | Plugin topic | | ==data/TWiki/%TOPIC%.txt,v== | Plugin topic repository | | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module | | ==pub/TWiki/%TOPIC%/*.jpg== | Screenshots for plugin topic | | ==bin/editTable== | | | ==bin/uploadTable== | | | ==templates/editnewTable.pattern.tmpl== | | | ==templates/editnewTable.tmpl== | | * Verify access and ownership settings for the new scripts. * Edit your .htaccess file to require a valid user for the included scripts (if needed). ---++ Plugin Info | Plugin Author: | TWiki:Main/ThomasWeigert | | Plugin Version: | 19 Nov 2006 | | Change History: | <!-- specify latest version first --> | | 19 Nov 2006: | Initial version, derived from TWiki:Plugins.EditTablerowPlugin | | CPAN Dependencies: | none | | Other Dependencies: | JSCalendarContrib | | Perl Version: | 5.0 | | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | | TWiki:Plugins/Benchmark: | %TWIKIWEB%.GoodStyle nn%, %TWIKIWEB%.FormattedSearch nn%, %TOPIC% nn% | | Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% | | Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev | | Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Appraisal | __Related Topics:__ %TWIKIWEB%.EditTablePlugin, %TWIKIWEB%.EditTablerowPlugin -- TWiki:Main/ThomasWeigert - 19 Nov 2006
Edit
|
Attach
|
P
rint version
|
H
istory
:
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r2 - 22 Sep 2006 - 00:07:18 -
TWikiGuest
TWiki/
Log In
or
Register
TWiki/ Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
User Reference
ATasteOfTWiki
TextFormattingRules
TWikiVariables
FormattedSearch
TWikiDocGraphics
TWikiSkinBrowser
InstalledPlugins
Admin Maintenance
Reference Manual
AdminToolsCategory
InterWikis
ManagingWebs
TWikiSiteTools
TWikiPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Webs
DnD
Main
Support
TWiki
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback