Examples of AjaxTextFieldPanel


Examples of org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel

        final Form schemaForm = new Form("form");

        schemaForm.setModel(new CompoundPropertyModel(schema));
        schemaForm.setOutputMarkupId(Boolean.TRUE);

        final AjaxTextFieldPanel name =
                new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(schema, "name"));

        name.addRequiredLabel();
        name.setEnabled(createFlag);

        final AjaxTextFieldPanel conversionPattern = new AjaxTextFieldPanel("conversionPattern",
                getString("conversionPattern"), new PropertyModel<String>(schema, "conversionPattern"));

        final IModel<List<String>> validatorsList = new LoadableDetachableModel<List<String>>() {

            private static final long serialVersionUID = 5275935387613157437L;

            @Override
            protected List<String> load() {
                return restClient.getAllValidatorClasses();
            }
        };

        final AjaxDropDownChoicePanel<String> validatorClass = new AjaxDropDownChoicePanel<String>("validatorClass",
                getString("validatorClass"), new PropertyModel(schema, "validatorClass"));

        ((DropDownChoice) validatorClass.getField()).setNullValid(true);
        validatorClass.setChoices(validatorsList.getObject());

        final AjaxDropDownChoicePanel<SchemaType> type = new AjaxDropDownChoicePanel<SchemaType>("type",
                getString("type"), new PropertyModel(schema, "type"));
        type.setChoices(Arrays.asList(SchemaType.values()));
        type.addRequiredLabel();

        final MultiValueSelectorPanel<String> enumerationValues =
                new MultiValueSelectorPanel<String>("enumerationValues",
                new Model(),
                new AjaxTextFieldPanel("panel", "enumerationValues", new Model(null)).addRequiredLabel());
        schemaForm.add(enumerationValues);

        enumerationValues.setModelObject((Serializable) getEnumValuesAsList(schema.getEnumerationValues()));

        final MultiValueSelectorPanel<String> enumerationKeys =
                new MultiValueSelectorPanel<String>("enumerationKeys",
                new Model(),
                new AjaxTextFieldPanel("panel", "enumerationKeys", new Model(null)));
        schemaForm.add(enumerationKeys);

        enumerationKeys.setModelObject((Serializable) getEnumValuesAsList(schema.getEnumerationKeys()));

        if (schema != null && SchemaType.Enum.equals(((SchemaTO) schema).getType())) {
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel

            final NotificationTO notificationTO, final boolean createFlag) {

        Form form = new Form("form", new CompoundPropertyModel(notificationTO));
        form.setModel(new CompoundPropertyModel(notificationTO));

        final AjaxTextFieldPanel sender = new AjaxTextFieldPanel("sender", getString("sender"),
                new PropertyModel<String>(notificationTO, "sender"));
        sender.addRequiredLabel();
        sender.addValidator(EmailAddressValidator.getInstance());
        form.add(sender);

        final AjaxTextFieldPanel subject = new AjaxTextFieldPanel("subject", getString("subject"),
                new PropertyModel<String>(notificationTO, "subject"));
        subject.addRequiredLabel();
        form.add(subject);

        final AjaxDropDownChoicePanel<String> template = new AjaxDropDownChoicePanel<String>("template",
                getString("template"), new PropertyModel(notificationTO, "template"));
        template.setChoices(restClient.getMailTemplates());
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel

        };

        bundleTO = getSelectedBundleTO(bundles.getObject(), connectorTO);
        properties = fillProperties(bundleTO, connectorTO);

        final AjaxTextFieldPanel connectorName = new AjaxTextFieldPanel(
                "connectorName", "connector name", new PropertyModel<String>(connectorTO, "connectorName"));
        connectorName.setOutputMarkupId(true);
        connectorName.setEnabled(false);

        final AjaxTextFieldPanel displayName = new AjaxTextFieldPanel(
                "displayName", "display name", new PropertyModel<String>(connectorTO, "displayName"));
        displayName.setOutputMarkupId(true);
        displayName.addRequiredLabel();

        final AjaxTextFieldPanel version = new AjaxTextFieldPanel(
                "version", "version", new PropertyModel<String>(connectorTO, "version"));
        displayName.setOutputMarkupId(true);
        version.setEnabled(false);

        final AjaxDropDownChoicePanel<ConnBundleTO> bundle =
                new AjaxDropDownChoicePanel<ConnBundleTO>("bundle", "bundle", new Model<ConnBundleTO>(bundleTO));
        bundle.setStyleShet("long_dynamicsize");
        bundle.setChoices(bundles.getObject());
        bundle.setChoiceRenderer(new ChoiceRenderer<ConnBundleTO>() {

            private static final long serialVersionUID = -1945543182376191187L;

            @Override
            public Object getDisplayValue(final ConnBundleTO object) {
                return object.getBundleName() + " " + object.getVersion();
            }

            @Override
            public String getIdValue(final ConnBundleTO object, final int index) {
                // idValue must include version as well in order to cope
                // with multiple version of the same bundle.
                return object.getBundleName() + "#" + object.getVersion();
            }
        });

        ((DropDownChoice) bundle.getField()).setNullValid(true);
        bundle.setRequired(true);
        bundle.getField().add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
                // reset all information stored in connectorTO
                connectorTO.setConfiguration(new HashSet<ConnConfProperty>());

                ((DropDownChoice) bundle.getField()).setNullValid(false);
                target.add(bundle.getField());

                target.add(connectorName);
                target.add(version);

                target.add(propertiesContainer);
            }
        });
        bundle.getField().setModel(new IModel<ConnBundleTO>() {

            private static final long serialVersionUID = -3736598995576061229L;

            @Override
            public ConnBundleTO getObject() {
                return bundleTO;
            }

            @Override
            public void setObject(final ConnBundleTO object) {
                if (object != null && connectorTO != null) {
                    connectorTO.setBundleName(object.getBundleName());
                    connectorTO.setVersion(object.getVersion());
                    connectorTO.setConnectorName(object.getConnectorName());
                    properties = fillProperties(object, connectorTO);
                    bundleTO = object;
                }
            }

            @Override
            public void detach() {
            }
        });
        bundle.addRequiredLabel();
        bundle.setEnabled(connectorTO.getId() == 0);

        final ListView<ConnConfProperty> view = new ListView<ConnConfProperty>(
                "connectorProperties", new PropertyModel(this, "properties")) {

            private static final long serialVersionUID = 9101744072914090143L;

            @Override
            protected void populateItem(final ListItem<ConnConfProperty> item) {
                final ConnConfProperty property = item.getModelObject();

                final Label label = new Label("connPropAttrSchema", property.getSchema().getDisplayName() == null
                        || property.getSchema().getDisplayName().isEmpty()
                        ? property.getSchema().getName()
                        : property.getSchema().getDisplayName());

                item.add(label);

                final FieldPanel field;

                boolean required = false;

                boolean isArray = false;

                if (property.getSchema().isConfidential()
                        || GUARDED_STRING.equalsIgnoreCase(property.getSchema().getType())
                        || GUARDED_BYTE_ARRAY.equalsIgnoreCase(property.getSchema().getType())) {

                    field = new AjaxPasswordFieldPanel("panel", label.getDefaultModelObjectAsString(), new Model());

                    ((PasswordTextField) field.getField()).setResetPassword(false);

                    required = property.getSchema().isRequired();

                } else {
                    Class<?> propertySchemaClass;

                    try {
                        propertySchemaClass =
                                ClassUtils.forName(property.getSchema().getType(), ClassUtils.getDefaultClassLoader());
                    } catch (Exception e) {
                        LOG.error("Error parsing attribute type", e);
                        propertySchemaClass = String.class;
                    }

                    if (NUMBER.contains(propertySchemaClass)) {
                        field = new AjaxNumberFieldPanel("panel", label.getDefaultModelObjectAsString(), new Model(),
                                ClassUtils.resolvePrimitiveIfNecessary(propertySchemaClass));

                        required = property.getSchema().isRequired();
                    } else if (Boolean.class.equals(propertySchemaClass) || boolean.class.equals(propertySchemaClass)) {
                        field = new AjaxCheckBoxPanel("panel", label.getDefaultModelObjectAsString(), new Model());
                    } else {
                        field = new AjaxTextFieldPanel("panel", label.getDefaultModelObjectAsString(), new Model());

                        required = property.getSchema().isRequired();
                    }

                    if (String[].class.equals(propertySchemaClass)) {
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel

                            item.add(component);

                            item.add(getActivationControl(component, !((List) classMethod.invoke(policy,
                                    new Object[]{})).isEmpty(), new ArrayList<String>(), new ArrayList<String>()));
                        } else {
                            final FieldPanel panel = new AjaxTextFieldPanel("panel", field.getName(), new Model(null));

                            panel.setRequired(true);

                            component = new MultiValueSelectorPanel<String>("field", new PropertyModel(policy, field.
                                    getName()), panel);

                            item.add(component);

                            final List<String> reinitializedValue = new ArrayList<String>();

                            reinitializedValue.add("");

                            item.add(getActivationControl(component, !((List<String>) classMethod.invoke(policy,
                                    new Object[]{})).isEmpty(), (Serializable) new ArrayList<String>(),
                                    (Serializable) reinitializedValue));
                        }
                    } else if (field.getType().equals(int.class) || field.getType().equals(Integer.class)) {

                        classMethod = policy.getClass().getMethod("get" + StringUtils.capitalize(field.getName()),
                                new Class[]{});

                        component = new AjaxTextFieldPanel("field", field.getName(), new PropertyModel(policy, field.
                                getName()));

                        item.add(component);

                        item.add(getActivationControl(component,
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel

        crontab = new CrontabContainer("crontab", new PropertyModel<String>(taskTO, "cronExpression"), taskTO
                .getCronExpression());
        form.add(crontab);

        final AjaxTextFieldPanel lastExec = new AjaxTextFieldPanel("lastExec", getString("lastExec"),
                new DateFormatROModel(new PropertyModel<String>(taskTO, "lastExec")));
        lastExec.setEnabled(false);
        profile.add(lastExec);

        final AjaxTextFieldPanel nextExec = new AjaxTextFieldPanel("nextExec", getString("nextExec"),
                new DateFormatROModel(new PropertyModel<String>(taskTO, "nextExec")));
        nextExec.setEnabled(false);
        profile.add(nextExec);

        final IndicatingAjaxButton submit = new IndicatingAjaxButton("apply", new ResourceModel("apply")) {

            private static final long serialVersionUID = -958724007591692537L;
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel

        propertiesContainer = new WebMarkupContainer("container");
        propertiesContainer.setOutputMarkupId(true);
        form.add(propertiesContainer);

        name = new AjaxTextFieldPanel("name", "name", this.reportletConf == null
                ? new Model()
                : new PropertyModel<String>(this.reportletConf, "name"));
        name.setOutputMarkupId(true);
        name.addRequiredLabel();
        form.add(name);
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel

                    .asList(type.getEnumConstants()));
        }

        // treat as String if nothing matched above
        if (result == null) {
            result = new AjaxTextFieldPanel(id, fieldName, model);
        }

        return result;
    }
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel

    public ConfigurationModalPage(final PageReference callPageRef, final ModalWindow window,
            final ConfigurationTO configurationTO, final boolean createFlag) {

        Form form = new Form("form", new CompoundPropertyModel(configurationTO));

        final AjaxTextFieldPanel key = new AjaxTextFieldPanel("key", "key", new PropertyModel(configurationTO, "key"));
        form.add(key);
        key.setEnabled(createFlag);
        key.addRequiredLabel();

        final AjaxTextFieldPanel value = new AjaxTextFieldPanel("value", "value", new PropertyModel(configurationTO,
                "value"));
        form.add(value);
        value.addRequiredLabel();

        submit = new IndicatingAjaxButton("apply", new Model<String>(getString("submit"))) {

            private static final long serialVersionUID = -958724007591692537L;
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel

                        required = property.getSchema().isRequired();
                    } else if (Boolean.class.equals(propertySchemaClass) || boolean.class.equals(propertySchemaClass)) {
                        field = new AjaxCheckBoxPanel("panel", label.getDefaultModelObjectAsString(), new Model());
                    } else {
                        field = new AjaxTextFieldPanel("panel", label.getDefaultModelObjectAsString(), new Model());

                        required = property.getSchema().isRequired();
                    }

                    if (String[].class.equals(propertySchemaClass)) {
View Full Code Here

Examples of org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel

        add(reportletConfWin);

        final Label idLabel = new Label("idLabel", new ResourceModel("id"));
        profile.add(idLabel);

        final AjaxTextFieldPanel id = new AjaxTextFieldPanel("id", getString("id"), new PropertyModel<String>(reportTO,
                "id"));
        id.setEnabled(false);
        profile.add(id);

        final Label nameLabel = new Label("nameLabel", new ResourceModel("name"));
        profile.add(nameLabel);

        final AjaxTextFieldPanel name = new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(
                reportTO, "name"));
        profile.add(name);

        final AjaxTextFieldPanel lastExec = new AjaxTextFieldPanel("lastExec", getString("lastExec"),
                new DateFormatROModel(new PropertyModel<String>(reportTO, "lastExec")));
        lastExec.setEnabled(false);
        profile.add(lastExec);

        final AjaxTextFieldPanel nextExec = new AjaxTextFieldPanel("nextExec", getString("nextExec"),
                new DateFormatROModel(new PropertyModel<String>(reportTO, "nextExec")));
        nextExec.setEnabled(false);
        profile.add(nextExec);

        final SingleColumnPalette<ReportletConf> reportlets = new SingleColumnPalette<ReportletConf>("reportlets",
                new PropertyModel<List<? extends ReportletConf>>(reportTO, "reportletConfs"),
                new IChoiceRenderer<ReportletConf>() {
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.