Submit hidden fields or properties in Constellation application - Custom way
Introduction
This document describes the steps to submit hidden fields ( the fields which are not configured in a form ) using specialized component.
The idea is to define properties in a custom view so that server can allow persisting those properties.
Steps
1. Create and configure a view where form submission need to consider hidden fields.
2. Add as a child view to form view.
3. Write custom dx component to set fields value.
import { useEffect } from "react"; const YXZOrg_reactlib_HiddenFields = (props: any) => { const {getPConnect} = props; const pConnect = getPConnect(); useEffect(() => { pConnect.setValue(".HiddenProp1", "I am hidden 1"); pConnect.setValue(".HiddenProp2", "I am hidden 2"); }, []); return null; }; export default YXZOrg_reactlib_HiddenFields;
More info on custom dx components:
https://github.com/pegasystems/constellation-ui-gallery
4. Open created view in dev studio and mark as custom.
5. Define custom dx component and list of hidden fields so that security can be allowed.
Example runtime trace: