Examples of FormField


Examples of org.camunda.bpm.engine.form.FormField

    TaskFormData taskFormData = formService.getTaskFormData(task.getId());

    List<FormField> formFields = taskFormData.getFormFields();

    FormField stringField = formFields.get(0);
    Map<String, String> properties = stringField.getProperties();
    assertEquals("property1", properties.get("p1"));
    assertEquals("property2", properties.get("p2"));

  }
View Full Code Here

Examples of org.camunda.bpm.engine.form.FormField

    TaskFormData taskFormData = formService.getTaskFormData(task.getId());

    List<FormField> formFields = taskFormData.getFormFields();

    FormField field1 = formFields.get(0);
    List<FormFieldValidationConstraint> validationConstraints = field1.getValidationConstraints();
    FormFieldValidationConstraint constraint1 = validationConstraints.get(0);
    assertEquals("maxlength", constraint1.getName());
    assertEquals("10", constraint1.getConfiguration());
    FormFieldValidationConstraint constraint2 = validationConstraints.get(1);
    assertEquals("minlength", constraint2.getName());
View Full Code Here

Examples of org.camunda.bpm.engine.form.FormField

    when(mockFormData.getFormProperties()).thenReturn(mockFormProperties);
    return mockFormData;
  }

  public static TaskFormData createMockTaskFormDataUsingFormFieldsWithoutFormKey() {
    FormField mockFormField = mock(FormField.class);
    when(mockFormField.getId()).thenReturn(EXAMPLE_FORM_PROPERTY_ID);
    when(mockFormField.getLabel()).thenReturn(EXAMPLE_FORM_PROPERTY_NAME);
    when(mockFormField.getDefaultValue()).thenReturn(EXAMPLE_FORM_PROPERTY_VALUE);

    FormType mockFormType = mock(FormType.class);
    when(mockFormType.getName()).thenReturn(EXAMPLE_FORM_PROPERTY_TYPE_NAME);
    when(mockFormField.getType()).thenReturn(mockFormType);

    TaskFormData mockFormData = mock(TaskFormData.class);
    when(mockFormData.getDeploymentId()).thenReturn(EXAMPLE_DEPLOYMENT_ID);

    List<FormField> mockFormFields = new ArrayList<FormField>();
View Full Code Here

Examples of org.camunda.bpm.engine.form.FormField

    when(mockFormData.getFormProperties()).thenReturn(mockFormProperties);
    return mockFormData;
  }

  public static StartFormData createMockStartFormDataUsingFormFieldsWithoutFormKey(ProcessDefinition definition) {
    FormField mockFormField = mock(FormField.class);
    when(mockFormField.getId()).thenReturn(EXAMPLE_FORM_PROPERTY_ID);
    when(mockFormField.getLabel()).thenReturn(EXAMPLE_FORM_PROPERTY_NAME);
    when(mockFormField.getDefaultValue()).thenReturn(EXAMPLE_FORM_PROPERTY_VALUE);

    FormType mockFormType = mock(FormType.class);
    when(mockFormType.getName()).thenReturn(EXAMPLE_FORM_PROPERTY_TYPE_NAME);
    when(mockFormField.getType()).thenReturn(mockFormType);

    StartFormData mockFormData = mock(StartFormData.class);
    when(mockFormData.getDeploymentId()).thenReturn(EXAMPLE_DEPLOYMENT_ID);
    when(mockFormData.getProcessDefinition()).thenReturn(definition);
View Full Code Here

Examples of org.directwebremoting.extend.FormField

        {
            Map<String, FormField> map = new HashMap<String, FormField>();
            List<FileItem> fileItems = fileUploader.parseRequest(req);
            for (final FileItem fileItem : fileItems)
            {
                FormField formField;
                if (fileItem.isFormField())
                {
                    formField = new FormField(fileItem.getString());
                }
                else
                {
                    InputStreamFactory inFactory = new SimpleInputStreamFactory(fileItem.getInputStream());
                    formField = new FormField(fileItem.getName(), fileItem.getContentType(), fileItem.getSize(), inFactory);
                }
                map.put(fileItem.getFieldName(), formField);
            }
            return map;
        }
View Full Code Here

Examples of org.gwtoolbox.widget.client.form.field.FormField

                return "<div id=\"" + parameter + "\"><div>";
            }
        });
        HTMLPanel panel = new HTMLPanel(html);
        for (String key : fields.getKeys()) {
            FormField field = fields.getField(key);
            panel.addAndReplaceElement(new Label(field.getLabel()), key + "#label");
            panel.addAndReplaceElement(field.getEditor().getWidget(), key + "#editor");
        }
        return panel;
    }
View Full Code Here

Examples of org.gwtoolbox.widget.client.form.field.FormField

     *
     * @param key the key to obtain the FormField for
     * @return FormField belonging to the provided key
     */
    public FormField getField(String key) throws NoSuchFormFieldException {
        FormField field = formFields.getField(key);
        if (field == null) {
            throw new NoSuchFormFieldException("No field with key " + key + " available in the form");
        }
        return field;
    }
View Full Code Here

Examples of org.gwtoolbox.widget.client.form.field.FormField

     * @return The validation result.
     */
    public FormValidationResult validate() {
        DefaultFormValidationResult result = new DefaultFormValidationResult();
        for (Map.Entry<String, FormField> entry : formFields.fieldByKey.entrySet()) {
            FormField field = entry.getValue();
            if (field.isEnabled()) {
                ValidationResult fieldResult = entry.getValue().validate();
                result.merge(field.getKey(), fieldResult);
            }
        }
        if (formValidator != null) {
            ValidationResult generalValidationResult = formValidator.validate(this);
            if (!generalValidationResult.isValid()) {
View Full Code Here

Examples of org.gwtoolbox.widget.client.form.field.FormField

     * @return A record representing the input data.
     */
    private Record collectData() {
        Map<String, Object> data = new HashMap<String, Object>();
        for (Map.Entry<String, FormField> entry : formFields.fieldByKey.entrySet()) {
            FormField field = entry.getValue();
            if (field.isEnabled()) {
                Object value = entry.getValue().getEditor().getValue();
                data.put(entry.getKey(), value);
            }
        }
        return new MapRecord(data);
View Full Code Here

Examples of org.internna.iwebmvc.metadata.ui.FormField

    private static FormFieldImpl createFormField(Field field) throws NoSuchMethodException, IllegalArgumentException, IllegalAccessException, IllegalAccessException, InvocationTargetException {
        FormFieldImpl formField = new FormFieldImpl();
        formField.setPath(field.getName());
        formField.setEmbeddedClass(field.getDeclaringClass());
        FormField form = field.getAnnotation(FormField.class);
        formField.setType(form.type());
        formField.setHelp(form.help());
        addValidation(field, formField);
        formField.setRenderCrud(form.renderCrud());
        if (EntityFilter.WIDGET_TYPE.EMBEDDED.equals(formField.getType())) formField.setSubfields(getSubFields(field));
        return formField;
    }
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.