Package org.apache.isis.viewer.scimpi.dispatcher.view.form

Examples of org.apache.isis.viewer.scimpi.dispatcher.view.form.InputField


    private static InputField[] createFields(final ObjectAction action, final ObjectAdapter object) {
        final int parameterCount = action.getParameterCount();
        final InputField[] fields = new InputField[parameterCount];
        for (int i = 0; i < fields.length; i++) {
            fields[i] = new InputField(ActionAction.parameterName(i));
        }
        return fields;
    }
View Full Code Here


    }

    private static void initializeFields(final RequestContext context, final ObjectAdapter object, final ObjectAction action, final InputField[] fields) {
        final List<ObjectActionParameter> parameters = action.getParameters();
        for (int i = 0; i < fields.length; i++) {
            final InputField field = fields[i];
            final ObjectActionParameter param = parameters.get(i);
            if (false /*action.isContributed() && i == 0*/) {
                // fields[i].setValue(context.mapObject(object,
                // Scope.INTERACTION));
                fields[i].setType(InputField.REFERENCE);
View Full Code Here

        if (defaultValues == null) {
            return;
        }

        for (int i = 0; i < fields.length; i++) {
            final InputField field = fields[i];
            final ObjectAdapter defaultValue = defaultValues[i];

            final String title = defaultValue == null ? "" : defaultValue.titleString();
            if (field.getType() == InputField.REFERENCE) {
                final ObjectSpecification objectSpecification = action.getParameters().get(i).getSpecification();
                if (defaultValue != null) {
                    final String imageSegment = showIcon ? "<img class=\"small-icon\" src=\"" + context.imagePath(objectSpecification) + "\" alt=\"" + objectSpecification.getShortIdentifier() + "\"/>" : "";
                    final String html = imageSegment + title;
                    final String value = context.mapObject(defaultValue, Scope.INTERACTION);
                    field.setValue(value);
                    field.setHtml(html);
                }
            } else {
                field.setValue(title);
            }
        }
    }
View Full Code Here

        final FormState entryState = (FormState) request.getContext().getVariable(ENTRY_FIELDS);
        boolean isforThisForm = entryState != null && entryState.isForForm(formId);
        if (entryState != null && entryState.isForForm(formId)) {
        }
        final InputField nameField = createdField("username", "User Name", InputField.TEXT, isforThisForm ? entryState : null);
        final String width = request.getOptionalProperty("width");
        if (width != null) {
            final int w = Integer.valueOf(width).intValue();
            nameField.setWidth(w);
        }
        final InputField passwordField = createdField("password", "Password", InputField.PASSWORD, isforThisForm ? entryState : null);
        final InputField[] fields = new InputField[] { nameField, passwordField, };

        final String formTitle = request.getOptionalProperty(FORM_TITLE);
        final String loginButtonTitle = request.getOptionalProperty(BUTTON_TITLE, "Log in");
        final String className = request.getOptionalProperty(CLASS, "login");
View Full Code Here

                className, id, formTitle, labelDelimiter, null, null, loginButtonTitle,
                isforThisForm && entryState != null ? entryState.getError() : null , null);       
    }

    protected static InputField createdField(final String fieldName, final String fieldLabel, final int type, final FormState entryState) {
        final InputField nameField = new InputField(fieldName);
        nameField.setType(type);
        nameField.setLabel(fieldLabel);
        if (entryState != null) {
            final FieldEditState fieldState = entryState.getField(fieldName);
            final String entry = fieldState == null ? "" : fieldState.getEntry();
            nameField.setValue(entry);
            final String error = fieldState == null ? "" : fieldState.getError();
            nameField.setErrorText(error);
        }
        return nameField;
    }
View Full Code Here

    private InputField[] createFields(final List<ObjectAssociation> fields) {
        final InputField[] formFields = new InputField[fields.size()];
        int length = 0;
        for (int i = 0; i < fields.size(); i++) {
            if (!fields.get(i).isOneToManyAssociation()) {
                formFields[i] = new InputField(fields.get(i).getId());
                length++;
            }
        }
        final InputField[] array = new InputField[length];
        for (int i = 0, j = 0; i < formFields.length; i++) {
View Full Code Here

    private InputField[] createFields(final List<ObjectAssociation> fields) {
        final InputField[] formFields = new InputField[fields.size()];
        int length = 0;
        for (int i = 0; i < fields.size(); i++) {
            if (!fields.get(i).isOneToManyAssociation()) {
                formFields[i] = new InputField(fields.get(i).getId());
                length++;
            }
        }
        final InputField[] array = new InputField[length];
        for (int i = 0, j = 0; i < formFields.length; i++) {
View Full Code Here

    private static InputField[] createFields(final ObjectAction action, final ObjectAdapter object) {
        final int parameterCount = action.getParameterCount();
        final InputField[] fields = new InputField[parameterCount];
        for (int i = 0; i < fields.length; i++) {
            fields[i] = new InputField(ActionAction.parameterName(i));
        }
        return fields;
    }
View Full Code Here

    }

    private static void initializeFields(final RequestContext context, final ObjectAdapter object, final ObjectAction action, final InputField[] fields) {
        final List<ObjectActionParameter> parameters = action.getParameters();
        for (int i = 0; i < fields.length; i++) {
            final InputField field = fields[i];
            final ObjectActionParameter param = parameters.get(i);
            if (action.isContributed() && i == 0) {
                // fields[i].setValue(context.mapObject(object,
                // Scope.INTERACTION));
                fields[i].setType(InputField.REFERENCE);
View Full Code Here

        if (defaultValues == null) {
            return;
        }

        for (int i = 0; i < fields.length; i++) {
            final InputField field = fields[i];
            final ObjectAdapter defaultValue = defaultValues[i];

            final String title = defaultValue == null ? "" : defaultValue.titleString();
            if (field.getType() == InputField.REFERENCE) {
                final ObjectSpecification objectSpecification = action.getParameters().get(i).getSpecification();
                if (defaultValue != null) {
                    final String imageSegment = showIcon ? "<img class=\"small-icon\" src=\"" + context.imagePath(objectSpecification) + "\" alt=\"" + objectSpecification.getShortIdentifier() + "\"/>" : "";
                    final String html = imageSegment + title;
                    final String value = context.mapObject(defaultValue, Scope.INTERACTION);
                    field.setValue(value);
                    field.setHtml(html);
                }
            } else {
                field.setValue(title);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.scimpi.dispatcher.view.form.InputField

Copyright © 2018 www.massapicom. 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.