Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

FormItem.setRequires(FormItem[] requiredFormeItems)

$
0
0
It's quite easy to implement oneself but as I just had to do it, I thought it might be a nice addition to SmartGWT overall.

Thing is: Let's say we have two SelectItems. (Which don't make a lot of sense)

month: Jan, Feb, ...
dayOfYear: 01. Jan, 02. Jan, ..., 03. Feb, ...

You want your user to be able to select multiple days, but always just from one month. So you would disable the "dayOfYear" SelectItem and enable it once a month has been selected.

My idea would be implementing a little something that automatically disables and enables a selectitem, depending on whether or not other FormItem.value()s are null.

Could also be called ".setDepends(FormItem[] requiredFormItems)"

Going a bit deeper, it might also be interesting to allow more advanced requirements. Like deciding between 'and' and 'or'...

Greetings,
Dennis.

Viewing all articles
Browse latest Browse all 4756

Trending Articles