Examples of AjaxFormComponentUpdatingBehavior


Examples of org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior

        add(syncTraceLevel);

        final AjaxCheckBoxPanel resetToken = new AjaxCheckBoxPanel("resetToken", new ResourceModel("resetToken",
                "resetToken").getObject(), new Model<Boolean>(null));

        resetToken.getField().add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget art) {
                if (resetToken.getModelObject()) {
                    resourceTO.setUsyncToken(null);
                    resourceTO.setRsyncToken(null);
                }
            }
        });
        add(resetToken);

        final AjaxDropDownChoicePanel<ConnInstanceTO> conn = new AjaxDropDownChoicePanel<ConnInstanceTO>("connector",
                new ResourceModel("connector", "connector").getObject(),
                new PropertyModel<ConnInstanceTO>(this, "connInstanceTO"));
        conn.setChoices(connectors.getObject());
        conn.setChoiceRenderer(new ChoiceRenderer("displayName", "id"));

        conn.getField().setModel(new IModel<ConnInstanceTO>() {

            private static final long serialVersionUID = -4202872830392400310L;

            @Override
            public ConnInstanceTO getObject() {
                return connInstanceTO;
            }

            @Override
            public void setObject(final ConnInstanceTO connector) {
                resourceTO.setConnectorId(connector.getId());
                connInstanceTO = connector;
            }

            @Override
            public void detach() {
            }
        });

        conn.addRequiredLabel();
        conn.setEnabled(createFlag);

        conn.getField().add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior

        Form paginatorForm = new Form("PaginatorForm");

        final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser", new PropertyModel(this, "paginatorRows"),
                prefMan.getPaginatorChoices());

        rowsChooser.add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior

            }
        };

        reportlets.setNullValid(true);
        profile.add(reportlets);
        reportlets.add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior

        } else {
            enumerationValues.setEnabled(Boolean.FALSE);
            enumerationKeys.setEnabled(Boolean.FALSE);
        }

        type.getField().add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
                if (AttributeSchemaType.Enum.ordinal() == Integer.parseInt(type.getField().getValue())) {
                    if (!enumerationValuesPanel.isRequired()) {
                        enumerationValuesPanel.addRequiredLabel();
                    }
                    enumerationValues.setEnabled(Boolean.TRUE);
                    enumerationValues.setModelObject((Serializable) getEnumValuesAsList(schema.getEnumerationValues()));

                    enumerationKeys.setEnabled(Boolean.TRUE);
                    enumerationKeys.setModelObject((Serializable) getEnumValuesAsList(schema.getEnumerationKeys()));
                } else {
                    if (enumerationValuesPanel.isRequired()) {
                        enumerationValuesPanel.removeRequiredLabel();
                    }
                    final List<String> values = new ArrayList<String>();
                    values.add("");

                    enumerationValues.setEnabled(Boolean.FALSE);
                    enumerationValues.setModelObject((Serializable) values);

                    final List<String> keys = new ArrayList<String>();
                    keys.add("");

                    enumerationKeys.setEnabled(Boolean.FALSE);
                    enumerationKeys.setModelObject((Serializable) keys);
                }

                target.add(schemaForm);
            }
        });

        final AutoCompleteTextField mandatoryCondition = new AutoCompleteTextField("mandatoryCondition") {

            private static final long serialVersionUID = -2428903969518079100L;

            @Override
            protected Iterator<String> getChoices(String input) {
                List<String> choices = new ArrayList<String>();

                if (Strings.isEmpty(input)) {
                    choices = Collections.emptyList();
                    return choices.iterator();
                }

                if ("true".startsWith(input.toLowerCase())) {
                    choices.add("true");
                } else if ("false".startsWith(input.toLowerCase())) {
                    choices.add("false");
                }

                return choices.iterator();
            }
        };

        mandatoryCondition.add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior

                "dropDownChoiceField", model, Collections.<T>emptyList(), new ChoiceRenderer<T>());

        add(field.setLabel(new Model(name)).setOutputMarkupId(true));

        if (enableOnBlur) {
            field.add(new AjaxFormComponentUpdatingBehavior("onblur") {

                private static final long serialVersionUID = -1107858522700306810L;

                @Override
                protected void onUpdate(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior

        super(id, name, model, datePattern);

        field = DateTextField.forDatePattern("field", model, datePattern);

        if (!isReadOnly()) {
            field.add(new AjaxFormComponentUpdatingBehavior("onchange") {

                private static final long serialVersionUID = -1107858522700306810L;

                @Override
                protected void onUpdate(AjaxRequestTarget art) {
View Full Code Here

Examples of org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior

        field = new DateTimeField("field", model);

        final Calendar cal = Calendar.getInstance();

        field.get("hours").add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
                if (((DateTimeField) field).getHours() > 12) {
                    cal.set(Calendar.HOUR_OF_DAY, ((DateTimeField) field).getHours());
                } else {
                    cal.set(Calendar.HOUR, ((DateTimeField) field).getHours());
                }
                field.setModelObject(cal.getTime());
            }
        });

        field.get("minutes").add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
                cal.set(Calendar.MINUTE, ((DateTimeField) field).getMinutes());
                field.setModelObject(cal.getTime());
            }
        });

        field.get("date").add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
                cal.setTime(((DateTimeField) field).getDate());

                if ("PM".equals("" + ((DateTimeField) field).getAmOrPm())) {
                    cal.set(Calendar.AM_PM, Calendar.PM);
                } else {
                    cal.set(Calendar.AM_PM, Calendar.AM);
                }

                field.setModelObject(cal.getTime());
            }
        });

        field.get("amOrPmChoice").add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior

        add(months);

        daysOfWeek = new TextField("daysOfWeek", new Model(getCronField(cronExpression, 5)));
        add(daysOfWeek);

        cronTemplateChooser.add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior

        Form confPaginatorForm = new Form("confPaginatorForm");

        final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser", new PropertyModel(this,
                "confPaginatorRows"), prefMan.getPaginatorChoices());

        rowsChooser.add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
View Full Code Here

Examples of org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior

        Form notificationPaginatorForm = new Form("notificationPaginatorForm");

        final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser", new PropertyModel(this,
                "notificationPaginatorRows"), prefMan.getPaginatorChoices());

        rowsChooser.add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.