I identified a new problem with the Java User Interface today.
If you create a prompt set with fields that:
Then if that other field is changed, these fields will appear to be reset, but will not be. If the prompt set is submitted without first choosing values for the reset fields, the original defaults will be used for these fields instead of blank values.
I don’t know what exact set of characteristics is required to trigger the problem, but I was not able to reproduce the problem with a much simpler prompt set that used STATIC VARAs as data sources and had plain text defaults. (It seems that in simpler cases the AE does a better job of validating currently-chosen values against the data sources before the object is activated.)
Below is the prompt set where we saw the problem.
The prompt set where we first saw the problem
In this prompt set, the Project prefix field is configured so that if it is changed, four other fields are reset:
We found that if we change the project prefix field, choose only a value for the Deployment Unit field, and then click Done without first selecting values for the other reset fields, the original initial default values of these three fields will be submitted. This obviously caused undesired results!
This does not happen in the Automic Web Interface (AWI). In the AWI, when the fields are reset, they really are set to empty values. If the prompt set is submitted without selecting new values for fields that have been reset, different errors can occur of course, because the values are blank. But at least the wrong values (and invisible values!) are not used.
The value required option would be a simple fix, but it is unfortunately not available for combo box elements, so there is no way to prevent the prompt set from being submitted before values have been chosen for the reset fields. (ainda02: Enabling the value required option for combo box elements seems like low-hanging fruit.)
Also, I submitted an idea years ago for a way to automatically re-evaluate prompt set defaults when fields are reset:
When resetting prompt set fields, honor default values, and reevaluate any variables therein
If this idea were implemented, this would give prompt set developers much more control over how fields are pre-populated in dynamic prompt sets.
I will not open a case with CA Support about this because the bug affects only the JUI, and I know CA is not keen to fix JUI bugs. However, I at least wanted to document the bug publicly to warn others about this unexpected behavior.