On Mar 26, 2004, at 11:11 AM, Joerg Heinicke wrote:
> On 26.03.2004 20:01, Mark Lundquist wrote: >> [Surjan wrote:] >>> >>> I thought of hiding the second list field if it's not required, but >>> I don't know how to do that either. >> Try this... > Hmm, if I read the above I think he only wants to conditionalize the > requiredness of selectionlist 2 in dependency on selectionlist 1, not > the displaying.
See above :-)
> This is what was called "optionally required" in discussions:
> http://marc.theaimsgroup.com/?t=107349479500003&r=1&w=4 <http://marc.theaimsgroup.com/?t=107349479500003&r=1&w=4>
>
> Vadim has provided a solution:
> http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=107352171910636&w=4 <http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=107352171910636&w=4>
>
> I have not used the XReporter expressions, but javascript using
> <wd:validation>
> <wd:javascript>
> if (widget1 != null && widget2 == null) {
> widget2.setValidationError =
> new ValidationError(general.required);
> } else {
> widget2.setValidationError = null;
> }
> </wd:javascript>
> </wd:validation>
Nice. How would I do that from flow? I could use form.onValidate()... or, can this be done on a per-widget basis in v2?
Thanks, mark
You've both been very helpful. Thanks.
I still have one outstanding issue: if I want to use the JXTemplate generator, how do I say "don't display this SelectionList widget, if it has no items"? (You see, the first widget can have any number of values. When the user makes a selection in the first drop-down, I make a db call to retrieve values for the second drop-down. I only want to hide the second one and make it not required if the the db returns zero items).
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
