WikiForms Form Plugin ExampleThis page uses the WikiForms plugins to provide parameters to the CurrentTimePlugin, Giving DefaultsThe first item, hidden in normal WikiPage viewing, looks like this: [{FormSet form='testform' format='EEE, d MMM yyyy HH:mm:ss Z' rd1='r2'}] [
Unknown macro: {FormSet form='testform' format='EEE, d MMM yyyy HH}
|
Unknown macro: {FormSetform='testform'format='EEE,dMMMyyyyHH}
[
Unknown macro: {FormOutput form='testform' handler='CurrentTimePlugin' populate='handler'}
] It specifies that the CurrentTimePlugin, which comes in the stock JSPWiki distribution, should be used to generate [ |(FormOutputform='testform'handler='CurrentTimePlugin'populate='handler')] Opening the FormThe third element starts the actual HTML form called testform: [{FormOpen form='testform'}] [
Unknown macro: {FormOpen form='testform'}
|(FormOpenform='testform')] Form FieldsWe'll use a text field to provide the format of CurrentTimePlugin's output. Notice that the name of this field is format - the name of CurrentTimePlugin's relevant parameter. This value is passed straight to CurrentTimePlugin on submit: Enter the time format string: [{FormInput type='text' name='format'}] Enter the time format string: [
Unknown macro: {FormInput type='text' name='format'}
|(FormInputtype='text'name='format')] The rest of the form merely demonstrates some other HTML form elements. The don't work with CurrentTimePlugin, but you'll probably want them in your special form handler plugins. Select list: [{FormSelect name='sel1' value='fee;*fie;foe;foo'}]UWC_TOKEN_DBBS (Notice, here, the asterisk; this denotes the default value to select. The separator character and the default character can be overridden - check FormSelect for more information.) [
Unknown macro: {FormSelect name='sel1' value='fee;*fie;foe;foo'}
|(FormSelectname='sel1'value='fee.*fie.foe.foo')] Textarea: [{FormTextarea name='area1' value='Write your own text here' rows=8 cols=40}] [
Unknown macro: {FormTextarea name='area1' value='Write your own text here' rows=8 cols=40}
|(FormTextareaname='area1'value='Writeyourowntexthere'rows=8cols=40)] SubmittingBefore finishing up, we need to add a submit button: [{FormInput type='submit' name='x' value='Update'}] [
Unknown macro: {FormInput type='submit' name='x' value='Update'}
|(FormInputtype='submit'name='x'value='Update')] Closing the FormAnd, finally, an invisible closing element to denote that this form has ended: [{FormClose}] -(FormClose) Go ahead, click on Update, and notice how your format changes and selections are retained. Synopsis:
|