public class FormSet extends Object implements WikiPlugin
The mandatory 'form' parameter specifies which form the variable applies to. Any other parameters are put directly into a FormInfo object that will be available to a Form plugin called 'form' (presumably invoked later on the same WikiPage).
If the name of a FormSet parameter is the same as the name of a Form plugin input element later on the same page, the Form will consider the given value the default for the form field. (However, the handler for the Form is free to use the value as it wishes, and even override it.)
If the name of a parameter is not present in Form input fields, the parameter is presumably meant for sending initial information to the Form handler. If this is the case, you may want to specify the populate='' in the Form open element, otherwise the form won't be displayed on the first invocation.
This object looks for a FormInfo object named FORM_VALUES_CARRIER in the WikiContext. If found, it checks that its name matches the 'form' parameter, and if it does, adds the plugin parameters to the FormInfo. If the names don't match, the old FormInfo is discarded and a new one is created. Only one FormInfo is supported at a time. A practical consequence of this is that a FormSet invocation only applies to the Form plugins that follow it; any further Forms need new FormSet calls.
|Constructor and Description|
|Modifier and Type||Method and Description|
This is the main entry point for any plugin.
public String execute(WikiContext ctx, Map<String,String> params) throws PluginException
Note that it is preferred that the plugin returns XHTML-compliant HTML (i.e. close all tags, use <br /> instead of <br>, etc.
ctx- The current WikiContext.
params- A Map which contains key-value pairs. Any parameter that the user has specified on the wiki page will contain String-String parameters, but it is possible that at some future date, JSPWiki will give you other things that are not Strings.
PluginException- In case anything goes wrong.
Copyright © 2001-2019 The Apache Software Foundation. All rights reserved.