You are here:
BACCHUS Wiki
>
System Web
>
UsersGuide
>
FrequentlyAskedQuestions
>
FAQAnApplicationWithWikiForm
(revision 1) (raw view)
This answer assumes you have basic knowledge about [[DataForms][Data Forms]]. Using the steps below, you will create: 1 A form definition 1 A topic creation (HTML) form to automatically attach a data form to a topic 1 A query search to find topics based on the data fields Step by step: <div class="foswikiFormSteps"> <div class="foswikiFormStep"> ---+++!! Create a data form definition See [[DataForms][Data Form]], specifically the section [[DataForms#FormTable][The form table]]. As an example we will create the topic "ReadingForm" with these contents: <verbatim class="tml"> | *Name* | *Type* | *Size* | *Values* | *Tooltip message* | *Attributes* | | Title | text | 80 | | Book or article title | | | Category | select | 1 | ,Interesting,Remarkable,So-so | How you rate this reading material | | | Author | text | 50 | | Author's last name | | </verbatim> </div> <div class="foswikiFormStep"> ---+++!! Enable the form Add the form in the list of Web forms. This is done by setting the preference =WEBFORMS= in the Web's WebPreferences (a comma separated list). If you create a topic, you can always add a form to the topic by choosing "Add form" in the edit screen. Now we will create an HTML form that does this automatically. </div> <div class="foswikiFormStep"> ---+++!! Create an HTML form for easy topic creation HTML forms have nothing to do with data forms, except that they are a way to create topics with pre-defined values. Example HTML form: <verbatim class="tml"> <form action="%SCRIPTURLPATH{edit}%/%WEB%/" method="post"> Name of the new topic: %BR% <input type="text" name="topic" class="foswikiInputField" size="32" /> Title of article or book: %BR% <input type="text" name="Title" class="foswikiInputField" size="32" /> <input type="submit" class="foswikiSubmit" value="Create topic" /> <input type="hidden" name="onlywikiname" value="on" /> <input type="hidden" name="formtemplate" value="ReadingForm" /> <input type="hidden" name="topicparent" value="%TOPIC%" /> </form> </verbatim> Now create a bunch of topics with this form. </div> <div class="foswikiFormStep"> ---+++!! Create a query search To list all topics that have a form named !ReadingForm: <verbatim class="tml"> %SEARCH{ type="query" "form.name = 'ReadingForm'" nonoise="on" format=" * [[$web.$topic][$formfield(Title)]]" }% </verbatim> To list all topics where the author name ends in "Auden": <verbatim class="tml"> %SEARCH{ type="query" "form.name = 'ReadingForm' AND Author ~ '*Auden'" nonoise="on" format=" * [[$web.$topic][$formfield(Title)]]" }% </verbatim> </div> </div> VarSEARCH has more information on creating searches. <!-- %JQREQUIRE{"chili"}% -->
System.FAQForm
edit
TopicClassification
FrequentlyAskedQuestion
Topic Summary
How can I create a simple data form based application?
Interested Parties
Related Topics
UserDocumentationCategory
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Edit
w
iki text
|
M
ore topic actions
Topic revision: r1 - 23 Aug 2010,
ProjectContributor
System
Log In
Toolbox
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
User Reference
BeginnersStartHere
TextFormattingRules
Macros
FormattedSearch
QuerySearch
DocumentGraphics
SkinBrowser
InstalledPlugins
Admin Maintenance
Reference Manual
AdminToolsCategory
InterWikis
ManagingWebs
SiteTools
DefaultPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Copyright &© by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding BACCHUS Wiki?
Send feedback