Interface IPluginFormPreRender
Use cases
- Providing the form with data from external data sources or web services
- Prefilling form fields
- Preventing forms from being sent to the user
When multiple pre-render plugins are installed, their order of execution is arbitrary. You should not rely on a certain fixed order.
Pre-render plugins are run for all forms of the client they belong to, or for all existing forms when installed as a system plugin. We recommend you check whether the plugin should be executed for the current form, for example by defining a plugin property containing a list of allowed forms.
Method signatures
IPluginFormPreRenderRetVal execute(IPluginFormPreRenderParams params) throws FCPluginException Transfer values: The IPluginFormPreRenderParams type provides the following properties: Access to the form request context (IFormRequestContext) and thus to central objects such as:
Return values: The return value must be of type IPluginFormPreRenderRetVal, a reference implementation is provided by the class PluginFormPreRenderRetVal.The object enables the transfer of a serialisable JSON object, which is available after delivery of the form to the browser, under the plugin name, in the form variable XFC_METADATA.Furthermore, setting the value map can cause fields to be pre-filled when the form is rendered. These values overwrite existing values if necessary and also replace values from URL parameters.If the plug-in is not processed correctly, an FCPluginException is thrown. |
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article