Class FormElement

java.lang.Object
org.apache.wiki.forms.FormElement
All Implemented Interfaces:
org.apache.wiki.api.plugin.Plugin
Direct Known Subclasses:
FormClose, FormInput, FormOpen, FormOutput, FormSelect, FormTextarea

public abstract class FormElement extends Object implements org.apache.wiki.api.plugin.Plugin
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The submit servlet may decide to store a FormInfo with user-entered form values in the Session.
    static final String
    In order to make the form-to-handler parameter transfer easier, we prefix all user-specified FORM element names with HANDLERPARAM_PREFIX the HTML output.
    static final String
    Show values.
    static final String
    Plugin parameter, mandatory, indicates what form element to insert.
    static final String
    Plugin parameter, mandatory in open/output: name of the form.
    static final String
    HTTP parameter, inserted as hidden variable into the generated form.
    static final String
    Plugin parameter, mandatory in output element, indicates Plugin to use to handle form submitted data.
    static final String
    Experimental: hide the form if it was submitted successfully.
    static final String
    Plugin parameter, mandatory in input elements: name of an element.
    static final String
    If set to 'handler' in output element, the handler plugin is called even on first invocation (no submit).
    static final String
    Plugin parameter, optional, indicates servlet to post to.
    static final String
    Plugin parameter, optional: default value for an input.

    Fields inherited from interface org.apache.wiki.api.plugin.Plugin

    CORE_PLUGINS_RESOURCEBUNDLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected FormInfo
    getFormInfo(org.apache.wiki.api.core.Context ctx)
    Attempts to retrieve information on the currently handled form from the Context.
    protected void
    storeFormInfo(org.apache.wiki.api.core.Context ctx, FormInfo info)
    Utility method stores a FormInfo object into the Context.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.wiki.api.plugin.Plugin

    execute, getDisplayName, getSnipExample
  • Field Details

    • HANDLERPARAM_PREFIX

      public static final String HANDLERPARAM_PREFIX
      In order to make the form-to-handler parameter transfer easier, we prefix all user-specified FORM element names with HANDLERPARAM_PREFIX the HTML output. This lets us differentiate user-defined FormHandler parameters from Form parameters. The submit handler must then use MapUtil.requestToMap() to strip them before executing the handler itself.
      See Also:
    • FORM_VALUES_CARRIER

      public static final String FORM_VALUES_CARRIER
      The submit servlet may decide to store a FormInfo with user-entered form values in the Session. It should use this name, and this class checks for it to pre-fill fields from a previous form submit.
      See Also:
    • HIDE_SUCCESS

      public static final String HIDE_SUCCESS
      Show values. Value is "onsuccess".
      See Also:
    • PARAM_SUBMITHANDLER

      public static final String PARAM_SUBMITHANDLER
      Plugin parameter, optional, indicates servlet to post to.
      See Also:
    • PARAM_ELEMENT

      public static final String PARAM_ELEMENT
      Plugin parameter, mandatory, indicates what form element to insert.
      See Also:
    • PARAM_HANDLER

      public static final String PARAM_HANDLER
      Plugin parameter, mandatory in output element, indicates Plugin to use to handle form submitted data.
      See Also:
    • PARAM_FORM

      public static final String PARAM_FORM
      Plugin parameter, mandatory in open/output: name of the form.
      See Also:
    • PARAM_INPUTNAME

      public static final String PARAM_INPUTNAME
      Plugin parameter, mandatory in input elements: name of an element.
      See Also:
    • PARAM_VALUE

      public static final String PARAM_VALUE
      Plugin parameter, optional: default value for an input.
      See Also:
    • PARAM_HIDEFORM

      public static final String PARAM_HIDEFORM
      Experimental: hide the form if it was submitted successfully.
      See Also:
    • PARAM_POPULATE

      public static final String PARAM_POPULATE
      If set to 'handler' in output element, the handler plugin is called even on first invocation (no submit). The plugin can then place values into its parameter map, and these are seen by subsequent Form elements. (Store a value in the plugin with the same key as an input element, and the value will be visible in the initial form.)
      See Also:
    • PARAM_FORMNAMEHIDDEN

      public static final String PARAM_FORMNAMEHIDDEN
      HTTP parameter, inserted as hidden variable into the generated form.
      See Also:
  • Constructor Details

  • Method Details

    • storeFormInfo

      protected void storeFormInfo(org.apache.wiki.api.core.Context ctx, FormInfo info)
      Utility method stores a FormInfo object into the Context.
      Parameters:
      ctx - The Context to store it in
      info - The FormInfo to store.
    • getFormInfo

      protected FormInfo getFormInfo(org.apache.wiki.api.core.Context ctx)
      Attempts to retrieve information on the currently handled form from the Context.
      Parameters:
      ctx - The Context
      Returns:
      The FormInfo from the context