checkGroup = new CheckGroup<>("buttonCheckSetGroup", model); checkGroup.setOutputMarkupId(true); checkGroup.setRenderBodyOnly(false); add(checkGroup); checkGroup.add(view);
/** * @see FormComponent#updateModel() */ public void updateModel() { Collection collection = (Collection)getModelObject(); if (collection == null) { collection = (Collection)getConvertedInput(); setModelObject(collection); } else { modelChanging(); collection.clear(); collection.addAll((Collection)getConvertedInput()); modelChanged(); } }
/** * @see FormComponent#getModelValue() */ @Override protected String getModelValue() { final StringBuilder builder = new StringBuilder(); final Collection<T> ts = getModelObject(); visitChildren(Check.class, new IVisitor<Check<T>, Void>() { @Override public void component(Check<T> check, IVisit<Void> visit) { if (ts.contains(check.getModelObject())) { if (builder.length() > 0) { builder.append(VALUE_SEPARATOR); } builder.append(check.getValue()); } } }); return builder.toString(); }
/** * Called when a selection changes. */ public final void onSelectionChanged() { convertInput(); updateModel(); onSelectionChanged(getModelObject()); }
/** * Factory method for create a new {@link CheckGroup}. * * @param <T> * the generic type of the model * @param id * the id * @param model * the model * @return the new {@link CheckGroup} */ public static <T> CheckGroup<T> newCheckGroup(final String id, final IModel<? extends Collection<T>> model) { final CheckGroup<T> checkGroup = new CheckGroup<>(id, model); checkGroup.setOutputMarkupId(true); return checkGroup; }
final CheckGroup<T> checkGroup = new CheckGroup<>("group", model); checkGroup.setOutputMarkupId(true); checkGroup.add(new IndicatorAjaxFormChoiceComponentUpdatingBehavior() { beans.setReuseItems(reuseItem); beans.setRenderBodyOnly(true); checkGroup.add(beans);
tag.put("name", group.getInputName()); tag.put("value", uuid); Collection<?> collection = (Collection<?>)group.getDefaultModelObject(); throw new WicketRuntimeException("CheckGroup [" + group.getPath() + "] contains a null model object, must be an object of type java.util.Collection"); if (group.hasRawInput()) final String raw = group.getRawInput(); if (!Strings.isEmpty(raw)) if (group.wantOnSelectionChangedNotifications()) CharSequence url = group.urlFor(IOnChangeListener.INTERFACE); Form<?> form = group.findParent(Form.class); if (form != null) (url.toString().indexOf('?') > -1 ? "&" : "?") + group.getInputName() + "=' + this.value;"); if (!isActionAuthorized(ENABLE) || !isEnabledInHierarchy() || !group.isEnabledInHierarchy()) final String marker = "wicket-" + getGroup().getMarkupId(); String clazz = tag.getAttribute("class"); if (Strings.isEmpty(clazz))
tag.put("name", group.getInputName()); tag.put("value", uuid); Collection collection = (Collection)group.getModelObject(); throw new WicketRuntimeException("CheckGroup [" + group.getPath() + "] contains a null model object, must be an object of type java.util.Collection"); if (group.hasRawInput()) final String[] input = group.getInputAsArray(); if (group.wantOnSelectionChangedNotifications()) CharSequence url = group.urlFor(IOnChangeListener.INTERFACE); Form form = (Form)group.findParent(Form.class); if (form != null) (url.toString().indexOf('?') > -1 ? "&" : "?") + group.getInputName() + "=' + this.value;"); if (!isActionAuthorized(ENABLE) || !isEnabled() || !group.isEnabled())
checkGroup.setOutputMarkupId(true); checkGroup.setRenderBodyOnly(false); add(checkGroup); checkGroup.add(view);
tag.put("name", group.getInputName()); tag.put("value", uuid); Collection<?> collection = (Collection<?>)group.getDefaultModelObject(); throw new WicketRuntimeException("CheckGroup [" + group.getPath() + "] contains a null model object, must be an object of type java.util.Collection"); if (group.hasRawInput()) final String raw = group.getRawInput(); if (!Strings.isEmpty(raw)) if (!isActionAuthorized(ENABLE) || !isEnabledInHierarchy() || !group.isEnabledInHierarchy())
/** * @see FormComponent#updateModel() */ @Override public void updateModel() { Collection<T> collection = getModelObject(); if (collection == null) { collection = getConvertedInput(); setDefaultModelObject(collection); } else { modelChanging(); collection.clear(); collection.addAll(getConvertedInput()); modelChanged(); } }
final CheckGroup<String> successGroup = new CheckGroup<>("successGroup", selected); successGroup.add(new IndicatorAjaxFormChoiceComponentUpdatingBehavior() { successGroup.setVisible(!events.isEmpty()); add(successGroup); successGroup.add(successView); final CheckGroup<String> failureGroup = new CheckGroup<>("failureGroup", selected); failureGroup.add(new IndicatorAjaxFormChoiceComponentUpdatingBehavior() { failureGroup.setVisible(!events.isEmpty()); add(failureGroup); failureGroup.add(failureView);
/** * Constructor that will create a default model collection * * @param id * component id */ public CheckGroup(String id) { super(id); setRenderBodyOnly(true); }
Check<T> checkbox = (Check<T>)visitChildren(Check.class, new Component.IVisitor<Check<T>>() Strings.join(",", values) + "] for CheckGroup component [" + getPath() + "] contains an illegal value [" + value +
/** * Factory method for create a new {@link CheckGroup}. This method is invoked in the constructor * from the derived classes and can be overridden so users can provide their own version of a * new {@link CheckGroup}. * * @param id * the id * @param model * the model * @return the new {@link CheckGroup} */ protected CheckGroup<T> newCheckGroup(final String id, final IModel<? extends Collection<T>> model) { final CheckGroup<T> checkGroup = ComponentFactory.newCheckGroup(id, model); checkGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() { /** The serialVersionUID. */ private static final long serialVersionUID = 1L; /** * {@inheritDoc} */ @Override protected void onUpdate(final AjaxRequestTarget target) { CheckGroupSelectorPanel.this.onUpdate(target); } }); return checkGroup; }
fragment.add(batchForm); group = new CheckGroup<>("checkgroup", model); group.add(new IndicatorAjaxFormChoiceComponentUpdatingBehavior() { group.add(dataTable);
checkGroup = new RadioGroup<String>("checkGroup", new Model<String>()); } else { checkGroup = new CheckGroup<String>("checkGroup", new HashSet<String>());
final boolean groupEnabled = group.isEnabledInHierarchy() && group.isEnableAllowed(); final boolean selfEnabled = isEnabledInHierarchy() && isEnableAllowed(); if (groupEnabled && selfEnabled) "onclick", "var cb=this.form['" + group.getInputName() + "']; if (cb!=null) { if (!isNaN(cb.length)) { for(var i=0;i<cb.length;i++) { if (cb[i].disabled) continue; if (cb[i].checked != this.checked) {cb[i].click();} } } else { if (!cb.disabled&&cb.checked != this.checked) {cb.click();} } }");
public Collection<T> getModelObject() { return group.getModelObject(); }
batchModal, builder.pageRef, new ArrayList<>(group.getModelObject()), builder.columns.size() == 1 ? builder.columns new BatchContent<>( builder.baseModal, new ArrayList<>(group.getModelObject()), builder.columns.size() == 1 ? builder.columns target); group.setModelObject(Collections.<T>emptyList()); target.add(group);