mode
option): create (default), edit, view (default if a topic exists)
hidden
option)
order
option)
rfp_<attribute>
)
layout
option)
%RENDERFORM{attr1="val1" attr2="val2" ...}%
%RENDERFORM{"DataFormDefinition"}% (=%RENDERFORM{form="DataFormDefinition"}%
)
%EDITTABLE{format="|text,20,|select,1,label,text,textarea,select,select+multi,checkbox,checkbox+buttons,radio,date|text,6,1|text,50|text,20|text,5,|"}% | *Name* | *Type* | *Size* | *Values* | *Tooltip message* | *Attributes* |
%RENDERFORM{"MyTestForm"}% %SEARCH{search="MyTestTopic\d+" scope="topic" type="regex"}%
| *Name* | *Type* | *Size* | *Values* | *Tooltip message* | *Attributes* | | Question | text | 80 | | | M | | Details | textarea | 80x10 | | please fill in some details ... | | | Answer | textarea | 80x10 | | Answer | | | State | select | 1 | open,closed | | |
%RENDERFORM{"SimpleHelpDeskForm" hidden="Answer,State" createbutton="submit" hideheader="yes" text="Back to !SimpleHelpDesk"}% | *Question* | *Date* | *State* | %SEARCH{search="SimpleHelpDesk\d+" scope="topic" type="regex" nonoise="on" format="| <a href=\"SimpleHelpDesk?rfp_topic=$topic;rfp_hidden=;rfp_hideheader=off\">$formfield(Question)</a> | $date | $formfield(State) |"}% %TOPIC%
| *Name* | *Type* | *Size* | *Values* | *Tooltip message* | *Attributes* | | Question | text | 80 | | | M | | Details | textarea | 80x10 | | please fill in some details ... | | | Answer | textarea | 80x10 | | Answer | | | State | select | 1 | open,closed | | |
%TOC% ---++ Question: %FORMFIELD{"Question"}% - State: %FORMFIELD{"State"}% Details: <pre> %FORMFIELD{"Details" default="no details"}% </pre> ---++ Answer %FORMFIELD{"Answer" default="no answer yet"}% ---++ Comments %COMMENT{type="threadmode"}%
%RENDERFORM{"NiceHelpDeskForm" templatetopic="NiceHelpDeskTemplate" hidden="Answer,State" createbutton="submit" hideheader="yes"}% | *Question* | *Date* | *State* | *Action* | %SEARCH{search="NiceHelpDesk\d+" scope="topic" type="regex" nonoise="on" format="| [[$topic][$formfield(Question)]]| $date | $formfield(State) | <a href=\"NiceHelpDesk?rfp_topic=$topic;rfp_hidden=;rfp_hideheader=off\" title=\"View form data\">[V]</a> <a href=\"NiceHelpDesk?rfp_topic=$topic;rfp_hidden=;rfp_hideheader=off;rfp_mode=edit\" title=\"edit form data\">[E]</a> | "}% %TOPIC%
Attribute | Description | Default / Example |
---|---|---|
dateformat |
overrides the JSCALENDARDATEFORMAT preference for date fields | dateformat="%d %b %Y" |
donotnotify |
disables notifications | undefined / donotnotify="on" |
form |
(required attribute) a name of a topic with a DataForms definition | undefined / form="MyTestForm" |
hidden |
a comma separated list of form field names to hide in all modes | undefined / hidden="Field1,Field2" |
hideheader |
if set, disables the form header | hideheader="no" |
layout |
a topic with a layout (see Form Layout section); syntax: layout="<topic>#<layout name>"; if layout name is omitted a default layout will be taken | undefined / layout="TestFormLayout#test1" |
mode |
render mode of the form, allowed values: create (default), edit, view (default if topic exists) |
mode="create" |
onlynewtopic |
disables overwrite of existing topics | onlynewtopic="on" |
onlywikiname |
disallows the usage of non-WikiWords for topic names | onlywikiname="on" |
order |
changes the display order of form fields; order value is a comma separated list of field names; if the order list is incomplete all missing and unhidden form fields will be added; there are special values for order: [:alpha:], [:dalpha:], [:num:] and [:dnum:], e.g. order="[:alpha:]" to sort all fields alphanumerical | undefined / order="Field1, Field2" |
redirectto |
used in the action script (Eg. save) to redirect the user to a desired page/URL after successful submit | undefined / redirectto="%BASETOPIC%" |
script |
changes the behavior of edit/create modes; allowed values: save - saves the form data; edit - edit the resulting topic | script="save" |
template |
a template name for predefined attributes | undefined / template="helpdesk" |
templatetopic |
a template topic; useful for the create mode | undefined / templatetopic="MyHelpDeskTopicTemplate" |
text |
the topic text; text will be ignored if a templatetopic is defined | undefined / text="my small topic text" |
topic |
an existing topic for edit and view mode or a topic template name for a new topic (create mode) (e.g. TestFormDataXXXXXXXXXX) | topic="%TOPIC%XXXXXXXXXX" / topic="TestFormData%SERVERTIME{$epoch}%" |
topicparent |
a topic parent; useful for the create mode; if undefined the form topic will be used | topicparent="%WEB%.%TOPIC%" / topicparent="MyHelpDesk" |
%RENDERFORM{"<form definition>" ... layout="<layout topic>"}%
%RENDERFORM{"<form definition>" ... layout="<layout topic>#<layout name>"}%
%STARTRENDERFORMLAYOUT%
and %STOPRENDERFORMLAYOUT%
, e.g: -- a default layout -- %STARTRENDERFORMLAYOUT% < your layout > %STOPRENDERFORMLAYOUT% -- OR a named layout -- %STARTRENDERFORMLAYOUT{"< layout name >"}% < your layout > %<nop>STOPRENDERFORMLAYOUT%= -- OR a named layout for view mode -- %STARTRENDERFORMLAYOUT{"< layout name >" mode="view"}% < your layout > %<nop>STOPRENDERFORMLAYOUT%=
mode
option in %STARTRENDERFORMLAYOUT%
this layout definition will be used only in the given mode (allowed modes: create,edit,view)
@< form field name >@
, e.g. @Question@
Following tags are reserved and replaced by ... | |
---|---|
Tag | Replaced by |
@FORMTOPIC@ | the form topic name |
@OPTION(<attribute name>)@ | the attribute value, e.g. @OPTION(mode)@ |
@SUBMIT@ | a submit button or empty string in view mode (hint: change the button text with the createbutton or editbutton attributes) |
@SWITCH@ | a link to switch between edit and view mode |
@TOPIC@ | the (target) topic name of the topic with a form |
fieldmarker
attribute.
<verbatim>...</verbatim>
tags to make the definition visible in the topic view.
<verbatim>
%STARTRENDERFORMLAYOUT% | *@TOPIC@@SWITCH@ / @FORM@*|| | Question%RED%*%ENDCOLOR% | @Question@ | | Details | @Details@ | | %RED%*%ENDCOLOR% indicates mandatory fields|| @SUBMIT@ %STOPRENDERFORMLAYOUT%
</verbatim>
Name | Type | Size | Values | Tooltip message | Attributes |
---|---|---|---|---|---|
Label | label | 0 | an example | label tooltip | |
Text | text | 10 | text tooltip | M | |
Textarea | textarea | 10x2 | textarea tooltip | ||
Select | select | 1 | ,1,2 | select tooltip | |
Select+Multi | select+multi | 5 | 1,2,3,4,5 | select+multi tooltip | |
Checkbox | checkbox | 2 | 1,2,3,4,5 | checkbox tooltip | |
Checkbox+Buttons | checkbox+buttons | 3 | 1,2,3,4,5 | checkbox+buttons tooltip | |
Radio | radio | 4 | 1,2,3,4,5,6,7,8,9 | radio tooltip | |
Date | date | 20 | date tooltip |
Topic | Date |
---|
%<plugin>_<ATTRIBUTENAME>%
to your SitePreferences topic, i.e. %RENDERFORM_SHORTDESCRIPTION%
You can also use template based preferences, just write RENDERFORM_TEMPLATE_<templatename>_<ATTRIBUTENAME>
.
data/debug.txt
) RenderFormPlugin.zip
in your Foswiki installation directory. Content: File: | Description: |
---|---|
data/System/RenderFormPlugin.txt | Plugin topic |
data/System/VarRENDERFORM.txt | Plugin Variables topic |
data/System/RenderFormPluginExampleForm.txt | Example form |
pub/System/RenderFormPlugin/example.gif | Example image |
lib/Foswiki/Plugins/RenderFormPlugin.pm | Plugin Perl module |
lib/Foswiki/Plugins/RenderFormPlugin/Core.pm | Plugin Perl module |
Change History: | |
V1.007 (18 Aug 2010): | Foswiki:Main.PaulHarvey: fixed plugin code to require JSCalendarContrib only once |
V1.006 (09 Oct 2009): | Foswiki:Main.PaulHarvey: added redirectto parameter |
V1.005 (13 Feb 2009): | Foswiki:Main.DanielRohde: fixed performance problems |
V1.004 (31 Jan 2009): | Foswiki:Main.KennethLavrsen: Foswikitask:Item907 Fixed a bug that causes JSCalendarContrib to stack overflow. Fix includes changing to official API way to add JSCalendar. |
V1.003 (16 Dec 2008): | Foswiki:Main.KennethLavrsen: Changed to Foswiki name space |
V1.002 (14 Oct 2008): | Foswiki:Main:DanielRohde: added layout feature; fixed date field bug; added missing docs; |
V1.001 (05 Oct 2008): | Foswiki:Main:DanielRohde: changed topicparent default; added and fixed docs; fixed date field bug; fixed non-word character in field names bug; |
V1.000 (04 Oct 2008): | Foswiki:Main:DanielRohde: Initial version |
Foswiki Dependency: | $Foswiki::Plugins::VERSION 1.1 |
CPAN Dependencies: | none |
Other Dependencies: | none |
Perl Version: | 5.008 |
Feedback: | http://foswiki.org/Extensions/RenderFormPluginDev |
Author | Foswiki:Main.DanielRohde |
Version | V1.007 (18 Aug 2010) |
Release | 18 Aug 2010 |
Repository | https://github.com/foswiki/RenderFormPlugin |
Copyright | © 2008, Foswiki:Main.DanielRohde |
License | GPL (GNU General Public License) |
Home | http://foswiki.org/Extensions/RenderFormPlugin |
Support | http://foswiki.org/Support/RenderFormPlugin |