java - Validate non or max. 1 checkbox is enabled in wicket listview -
how can validate not more 1 checkbox selected in listview (repeater)?
i have form listview in wicket following structure:
line 1 n: ajaxcheckbox
, textfield
both elements connected compoundpropertymodel<simpletype>
. pojo simpletype looks like:
public class simpletype { private boolean enabled; private string value; getter/setter... }
if more 1 checkbox selected, form should reject changes. user must deselect selected checkbox first before can choose checkbox. tried surrounded checkgroup
ivalidator<collection<simpletype>>
, need change ajaxcheckbox
component check
. in case check
seems not updated state enabled
compoundpropertymodel
.
do need validator or visitor case? how implement them?
since radio not option here simple solution should work:
for validation use iformvalidator visits ajaxcheckbox-es.
for immediate ui response i'd use plain js unchecks previous checked checkbox. fire wicket ajax call unselect @ server side too. once complete form submitted iformvalidator work.
Comments
Post a Comment