On Wed, May 14, 2014 at 1:51 AM, John Chilton firstname.lastname@example.org wrote:
Hmm.... So my understanding of the way Galaxy sort of iteratively builds up tool parameters is that each time there is a state update it validates all of the old state (this is where the red errors come from) and then generates the new state - but it never validates the new state before re-rendering the form. At the beginning the whole state is "new" and this is why you don't get the red warning initially for the column not existing but you do upon subsequent form re-renders.
The easiest way to demonstrate this behavior is take an empty history and click on the concatenate datasets tool. There are no warning initially even though the data parameter is empty and invalid - but if you click to "Add New Dataset" to the tool - it re-renders and you get a warning on the first data input but not on the new one. Same thing happens to the second input if you add another dataset to the repeat.
I do not know why the initial state is not validated, but the following quick patch forces that new state to be validated if you want this behavior. It implements the red warning you were hoping for (at least on the initial rendering of the tool). A more complete patch might seek to validate all new state - or re-validate everything after state has been populated.
Anyone aware of pitfalls of enabling this behavior? Anyone besides Peter feel it is an issue that should be addressed?
Hmm instead. This is a tricky one, and I don't know enough about the internals to have a technical opinion here.
That sounds like it would solve my use-case, which is good.
The potential downside of this is it could give red error boxes on things like required parameters with no default value - that might be considered scary/unfriendly?