public HeaderAuthFilterPanel(String id, IModel<RequestHeaderAuthenticationFilterConfig> model) { super(id, model); add(new TextField("principalHeaderAttribute").setRequired(true)); } }
@Override @SuppressWarnings({ "rawtypes", "unchecked" }) protected TextField newTextField(final String id, final IModel<T> modelSuper) { final TextField<String> textField = new TextField<String>(id, new PropertyModel<>(model, "username")); textField.setOutputMarkupId(true); textField.setRequired(true); if (placeholderModel != null) { textField.add(new AttributeAppender("placeholder", placeholderModel)); } return textField; } };
@Override public String getObject() { return textField.getModelObject(); } }) {
/** * Factory method for create a new {@link TextField}. * * @param <T> * the generic type of the model * @param id * the id * @param model * the model * @return the new {@link TextField}. */ public static <T> TextField<T> newTextField(final String id, final IModel<T> model) { final TextField<T> textField = new TextField<>(id, model); textField.setOutputMarkupId(true); return textField; }
public GClientGeocoder(String event, TextField<?> addressField, Duration timeout, final String scheme, final String apiKey) { super(event); addressField.setOutputMarkupId(true); this.addressFieldMarkupId = addressField.getMarkupId(); this.headerContrib = new GMapHeaderContributor(scheme, apiKey); this.timeout = timeout; }
public XMLUserGroupServicePanel(String id, IModel<XMLUserGroupServiceConfig> model) { super(id, model); add(new TextField("fileName").setEnabled(isNew())); add(new CheckBox("validating")); add(new TextField("checkInterval")); } }
private TextField<String> buildTextField(String id, IModel<IRI> model) { IModel<String> adapter = new LambdaModelAdapter<String>( () -> model.getObject().stringValue(), str -> model.setObject(SimpleValueFactory.getInstance().createIRI(str))); TextField<String> iriTextfield = new TextField<>(id, adapter); iriTextfield.setOutputMarkupId(true); iriTextfield.add(new LambdaAjaxFormComponentUpdatingBehavior("change", t -> { // Do nothing just update the model values })); iriTextfield.setEnabled(false); return iriTextfield; }
private TextField<Integer> createMinutesField(String id, int minutes) { TextField<Integer> field = new TextField<>(id, Model.of(minutes), Integer.class); field.setOutputMarkupId(true); field.add(RangeValidator.range(0, 59)); return field; }
/** * @param id Wicket component id * @param valueModel Model for the value to display in the panel (string) * @param rowObject The row object (which the value model gets the information from) * @return Construct a new text field. */ protected TextField<String> newTextField(String id, IModel<String> valueModel, T rowObject) { return new TextField<>(id, valueModel); }
@Override protected Component getStoredQueryNameComponent() { Fragment f = new Fragment("storedQueryName", "newPage", this); storedQueriesDropDown = storedQueriesDropDown(); f.add(storedQueriesDropDown); TextField<String> textField = new TextField<>("nativeName", new PropertyModel<>(this, "nativeName")); textField.setRequired(true); textField.add(new ViewNameValidator()); f.add(textField); return f; }
public EditableTextFieldCellPanel(String id, PropertyColumn<T, S> column) { super(id); TextField<T> field = new TextField<T>("textfield"); field.setOutputMarkupId(true); field.setLabel(column.getDisplayModel()); addBehaviors(field); add(field); }
/** * Allows behaviours to be placed on the inner text field. * * This can be used to add an onblur action to push results to the server side. * * @param beh */ public void addBehaviorToAutoCompletingTextField(Behavior beh) { this.searchField.add(beh); }
@Override protected void onInitialize() { super.onInitialize(); // TextField // this.input = this.newTextField("text", this.getModel()); this.input.setOutputMarkupId(true); this.input.add(this.newToggleBehavior()); this.add(this.input); // DatePicker // this.datepicker = new RangeDatePicker("datepicker", this.getModel(), this.options) { private static final long serialVersionUID = 1L; @Override public void onValueChanged(IPartialPageRequestHandler handler) { RangeDatePickerTextField.this.input.modelChanged(); RangeDatePickerTextField.this.onValueChanged(handler); handler.add(RangeDatePickerTextField.this.input); } }; this.add(this.datepicker); }
@SuppressWarnings("unchecked") public RequiredTextFieldWidget(String id, IModel<String> model, IModel<String> labelModel) { super(id, model, labelModel); TextField<String> t = (TextField<String>) get("widget"); t.setRequired(true); }
@Override public void onUpdate(AjaxRequestTarget aTarget) { if (getModelObject()) { queryLimitField.setModelObject(kbProperties.getHardMaxResults()); queryLimitField.setEnabled(false); } else { queryLimitField.setEnabled(true); } aTarget.add(queryLimitField); } };
/** * Construct. * * @param event */ public GClientGeocoder(String event, TextField<?> addressField, String key) { super(event); this.addressField = addressField; this.addressField.setOutputMarkupId(true); headerContrib = new GMapHeaderContributor(key); }
@Override public void validate() { super.validate(); // Checking if the name provided already exists or not if (constraintsService.existConstraintSet(constraintNameTextField.getInput(), ProjectConstraintsPanel.this.getModelObject()) && !constraintNameTextField.getInput() .equals(constraintNameTextField.getModelObject())) { error("Provided name for Constraint already exists, please choose a different name"); } } });