From af1f3682be70540ac09de95c7bb7f643963e698a Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Tue, 22 Oct 2024 10:50:58 -0400 Subject: [PATCH] add a note for using data-set with data-hide (#1006) --- .../interactive/dynamic-form-widgets.rst | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/how-tos/app-development/interactive/dynamic-form-widgets.rst b/source/how-tos/app-development/interactive/dynamic-form-widgets.rst index 17ac64a0..abfca96f 100644 --- a/source/how-tos/app-development/interactive/dynamic-form-widgets.rst +++ b/source/how-tos/app-development/interactive/dynamic-form-widgets.rst @@ -81,6 +81,15 @@ Here's the example YAML for this app with two select widgets. This instructs the webpage to hide the ``cuda_version`` when the ``standard`` ``node_type`` is selected. +.. warning:: + In addition to hiding form fields like this example shows, one should + also use a ``data-set`` directive to set the value because the field + is no longer visible to the user. While it's hidden, it will still retain + the current value, if any has been supplied. + + By forcing a value after hiding it you can ensure that the correct values + are being passed to the server. + .. code-block:: yaml :emphasize-lines: 7 @@ -90,7 +99,8 @@ instructs the webpage to hide the ``cuda_version`` when the ``standard`` options: - [ 'standard', 'standard', - data-hide-cuda-version: true + data-hide-cuda-version: true, + data-set-cuda-version: 'none' ] - 'gpu'