From 3a66f1ad9a3bf4c771f3785857f83fdb575258ec Mon Sep 17 00:00:00 2001 From: Ryan Cooney Date: Tue, 26 Mar 2024 14:18:38 -0700 Subject: [PATCH 1/3] Document how to set a form element's value at runtime --- ...web-implement-star-rating-form-element.mdx | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/docs/workflow/tutorial-web-implement-star-rating-form-element.mdx b/docs/workflow/tutorial-web-implement-star-rating-form-element.mdx index a70f2aff4..a3992e2d1 100644 --- a/docs/workflow/tutorial-web-implement-star-rating-form-element.mdx +++ b/docs/workflow/tutorial-web-implement-star-rating-form-element.mdx @@ -200,11 +200,11 @@ export default StarRatingElementRegistration; -## Deploy the Activity +## Deploy the Form Element Follow the instructions to [build and deploy the activity pack](sdk-web-overview.mdx#deployment). -## Test the Activity +## Test the Form Element Once your activity pack is hosted and registered, your custom form element should appear in the form element toolbox in VertiGIS Studio Workflow Designer alongside the built-in form elements, and can be used in the graphical interface like any other form element. @@ -242,6 +242,25 @@ Once your activity pack is hosted and registered, your custom form element shoul

::: - + + +## Set the Form Element's Value at Runtime + +Depending on the use case for the custom form element you may want to display it with an initial value that that is provided at runtime by the workflow. In the case of the Star Rating form element we may want to initially select four stars, or some number computed by the workflow. + +To assign a `value` to a custom form element at runtime: + +1. Open your workflow in VertiGIS Studio Workflow Designer. +1. Double-click the `Display Form` activity that contains the custom form element. +1. Select the custom form element. +1. Expand the `Events` section of the `Properties` panel. +1. On the `load` event click `Add` or `Edit`. +1. Add a `Set Form Element Property` activity from the toolbox to the subworkflow. +1. Set the `Property Name` input to `value` +1. Set the `Property Value` input to an expression that assigns the desired value. For example: + - Literal value: `=4` + - Variable value: `=$numberOfStars.result` + +:::note +You can use the `Set Form Element Property` activity to assign a value to any prop of a custom form element React component. +::: From 941a0af0b9e2f1eb82c9ab841aa7d5cea2e38848 Mon Sep 17 00:00:00 2001 From: Ryan Cooney Date: Tue, 26 Mar 2024 14:24:29 -0700 Subject: [PATCH 2/3] typo --- .../tutorial-web-implement-star-rating-form-element.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow/tutorial-web-implement-star-rating-form-element.mdx b/docs/workflow/tutorial-web-implement-star-rating-form-element.mdx index a3992e2d1..b51eb79da 100644 --- a/docs/workflow/tutorial-web-implement-star-rating-form-element.mdx +++ b/docs/workflow/tutorial-web-implement-star-rating-form-element.mdx @@ -253,7 +253,7 @@ To assign a `value` to a custom form element at runtime: 1. Open your workflow in VertiGIS Studio Workflow Designer. 1. Double-click the `Display Form` activity that contains the custom form element. 1. Select the custom form element. -1. Expand the `Events` section of the `Properties` panel. +1. Expand the `Events` section of the properties panel. 1. On the `load` event click `Add` or `Edit`. 1. Add a `Set Form Element Property` activity from the toolbox to the subworkflow. 1. Set the `Property Name` input to `value` From 722b613279b9bcdf74b93594a2b2f993886ed952 Mon Sep 17 00:00:00 2001 From: Ryan Cooney Date: Tue, 26 Mar 2024 14:25:18 -0700 Subject: [PATCH 3/3] typo --- .../tutorial-web-implement-star-rating-form-element.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow/tutorial-web-implement-star-rating-form-element.mdx b/docs/workflow/tutorial-web-implement-star-rating-form-element.mdx index b51eb79da..d6482fce1 100644 --- a/docs/workflow/tutorial-web-implement-star-rating-form-element.mdx +++ b/docs/workflow/tutorial-web-implement-star-rating-form-element.mdx @@ -258,7 +258,7 @@ To assign a `value` to a custom form element at runtime: 1. Add a `Set Form Element Property` activity from the toolbox to the subworkflow. 1. Set the `Property Name` input to `value` 1. Set the `Property Value` input to an expression that assigns the desired value. For example: - - Literal value: `=4` + - Literal value: `4` - Variable value: `=$numberOfStars.result` :::note