public AbstractView(String wicketId, IDataProvider<T> provider) { super(wicketId, provider); setItemReuseStrategy(new ManagedReuseStrategy<T>() { private static final long serialVersionUID = 1L; @Override public void destroyItem(Item<T> item) { AbstractView.this.destroyItem(item); } }); }
@Override protected void onUpdate(AjaxRequestTarget target) { BooleanFieldWidget.this.onUpdate(target); } });
@Override protected void onUpdate(final AjaxRequestTarget target) { AjaxUpdatingWidget.this.onUpdate(target); } });
public AjaxDateTimeField(String id, IModel<Date> model, boolean todayLinkVisible) { super(id, model); get("date").add(new ChangeBehaviour()); get("hours").add(new ChangeBehaviour()); get("minutes").add(new ChangeBehaviour()); get("amOrPmChoice").add(new ChangeBehaviour()); setOutputMarkupId(true); add(new AjaxLink<Date>("today") { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { updateDateTime(new Date(), null, null, target); } }.setVisible(todayLinkVisible)); }
@Override protected void onUpdate(AjaxRequestTarget target) { AutoCompleteTextFieldWidget.this.onUpdate(target); } });
/** * Starts a default ping wicket components which uses the indicated duration between ping intervals. * After the elapse of each interval a roundtrip to the server is made using an Ajax call. * When the duration is negative, this wicket component behaves like a plain Label widget. * @param id the wicket id to use * @param interval the time to wait between ping interfals */ public Pinger(String id, Duration interval) { super(id); if (interval != null) { if (interval.greaterThan(0L)) { add(new PingBehavior(interval)); } } else { add(new PingBehavior(Duration.seconds(DEFAULT_INTERVAL_SECONDS))); } }
@Override protected void onValidate(IValidatable<String> validatable) { String modelValue = myModel.getObject() != null ? myModel.getObject() : ""; String formValue = validatable.getValue() != null ? (String) validatable.getValue() : ""; if (modelValue.length() == 0 && formValue.length() == 0) { PasswordTextFieldWidget.this.error("Password is required"); } }
public AutoCompleteTextFieldWidget(final String id, final IModel<T> model, final AutoCompleteSettings settings) { super(id, model, settings); add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { AutoCompleteTextFieldWidget.this.onUpdate(target); } }); }
public BooleanFieldWidget(String id, IModel<Boolean> model) { super(id, model); addFormField(new AjaxCheckBox("widget", model) { @Override protected void onUpdate(AjaxRequestTarget target) { BooleanFieldWidget.this.onUpdate(target); } }); } }
@Override public void collapse(final AjaxRequestTarget target) { // mouseLeave is never triggered when opening the context menu. Because of this the tree has to be // marked dirty so that the mouse listeners on the current item are reset dirty = true; super.collapse(target); } };
@Override protected void onUpdate(AjaxRequestTarget target) { AjaxDateTimeField.this.onUpdate(target); } }
@Override public void destroyItem(Item<T> item) { AbstractView.this.destroyItem(item); } });
@Override public String getObject() { return renderNode(node, level); } }));
@SuppressWarnings("unchecked") private <T> FormComponent<T> getField(String id) { return (FormComponent<T>) get(id); }
@SuppressWarnings("unchecked") public IModel<T> getModel() { return (IModel<T>) getDefaultModel(); }
public MyModel(IModel<String> model) { setChainedModel(model); }
public Component getFocusComponent() { return getFormComponent(); }
@Override public final void onTargetRespond(final AjaxRequestTarget target) { super.onTargetRespond(target); onTargetRespond(target, dirty); dirty = false; }
public PasswordValueTemplatePlugin(IPluginContext context, IPluginConfig config) { super(context, config); add(new PasswordTextFieldWidget("value", getModel())); setOutputMarkupId(true); }
@Override protected void onUpdate(final AjaxRequestTarget target) { AjaxUpdatingWidget.this.onUpdate(target); }