Examples of FormValidator


Examples of org.jboss.ballroom.client.widgets.forms.FormValidator

        txItem.setDefaultToFirstOption(true);
        txItem.setValueMap(new String[]{"NoTransaction", "LocalTransaction", "XATransaction"});

        form.setFields(name,archiveItem, moduleItem, txItem);

        form.addFormValidator(new FormValidator() {
            @Override
            public void validate(List<FormItem> items, FormValidation outcome) {
                TextBoxItem archive = (TextBoxItem)findItem(items, "archive");
                TextBoxItem module = (TextBoxItem)findItem(items, "module");
View Full Code Here

Examples of org.joget.apps.form.model.FormValidator

            element.setOptionsBinder(optionsBinder);
            FormStoreBinder storeBinder = (FormStoreBinder) FormUtil.parseBinderFromJsonObject(obj, FormBinder.FORM_STORE_BINDER);
            element.setStoreBinder(storeBinder);

            // set validator
            FormValidator validator = FormUtil.parseValidatorFromJsonObject(obj);
            if (validator != null) {
                validator.setElement(element);
                element.setValidator(validator);
            }
        }

        return element;
View Full Code Here

Examples of org.joget.apps.form.model.FormValidator

     * @param obj
     * @return
     * @throws Exception
     */
    public static FormValidator parseValidatorFromJsonObject(JSONObject obj) throws Exception {
        FormValidator validator = null;
        PluginManager pluginManager = (PluginManager) appContext.getBean("pluginManager");
        if (!obj.isNull(FormUtil.PROPERTY_PROPERTIES)) {
            JSONObject objProperty = obj.getJSONObject(FormUtil.PROPERTY_PROPERTIES);
            if (!objProperty.isNull(FormUtil.PROPERTY_VALIDATOR)) {
                String validatorStr = objProperty.getString(FormUtil.PROPERTY_VALIDATOR);
                JSONObject validatorObj = new JSONObject(validatorStr);

                // create validator object
                if (!validatorObj.isNull(FormUtil.PROPERTY_CLASS_NAME)) {
                    String className = validatorObj.getString(FormUtil.PROPERTY_CLASS_NAME);
                    if (className != null && className.trim().length() > 0) {
                        validator = (FormValidator) pluginManager.getPlugin(className);
                        if (validator != null) {
                            // set child properties
                            Map<String, Object> properties = FormUtil.parsePropertyFromJsonObject(validatorObj);
                            validator.setProperties(properties);
                        }
                    }
                }
            }
        }
View Full Code Here

Examples of org.joget.apps.form.model.FormValidator

     * @return true if all validators are successful.
     */
    public static boolean executeValidators(Element element, FormData formData) {
        boolean result = true;
        if (element.continueValidation(formData)) {
            FormValidator validator = (FormValidator) element.getValidator();
            if (validator != null) {
                String[] values = FormUtil.getElementPropertyValues(element, formData);
                result = validator.validate(element, formData, values) && result;
            }
            result = element.selfValidate(formData) && result;
           
            Collection<Element> children = element.getChildren(formData);
            if (children != null) {
View Full Code Here

Examples of org.joget.apps.form.model.FormValidator

     * @param formData
     * @return
     */
    public static String getElementValidatorDecoration(Element element, FormData formData) {
        String decoration = "";
        FormValidator validator = element.getValidator();
        if (validator != null) {
            decoration = validator.getElementDecoration(element, formData);
            if (decoration == null) {
                decoration = "";
            }
        }
        return decoration;
View Full Code Here

Examples of org.joget.apps.form.model.FormValidator

        // set properties
        JSONObject jsonProps = FormUtil.generatePropertyJsonObject(element.getProperties());
        jsonObj.put(FormUtil.PROPERTY_PROPERTIES, jsonProps);

        // set validator
        FormValidator validator = element.getValidator();
        if (validator != null) {
            JSONObject jsonValidatorProps = FormUtil.generatePropertyJsonObject(validator.getProperties());
            JSONObject jsonValidator = new JSONObject();
            jsonValidator.put(FormUtil.PROPERTY_CLASS_NAME, validator.getClassName());
            jsonValidator.put(FormUtil.PROPERTY_PROPERTIES, jsonValidatorProps);
            jsonProps.put(FormUtil.PROPERTY_VALIDATOR, jsonValidator);
        }

        // set load binder
View Full Code Here

Examples of org.openmrs.validator.FormValidator

        ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", "error.null");
        ValidationUtils.rejectIfEmptyOrWhitespace(errors, "xmlData", "error.null");

        if (hf.getForm() != null) {
          errors.pushNestedPath("form");
          new FormValidator().validate(hf.getForm(), errors);
          errors.popNestedPath();
        }
        if (hf.getXmlData() != null) {
            try {
                @SuppressWarnings("unused")
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.modules.gui.commonswing.FormValidator

    pack();
    clear();
    initializeFromJob(reportJob, guiContext);
    createParametersPanelContent();

    final FormValidator formValidator = getFormValidator();
    formValidator.setEnabled(false);
    final ModifiableConfiguration repConf = reportJob.getReportConfiguration();
    final boolean inputStorageEnabled = isInputStorageEnabled(repConf);

    final Configuration loadedConfiguration;
    if (inputStorageEnabled)
    {
      loadedConfiguration = loadFromConfigStore(reportJob, repConf);
    }
    else
    {
      loadedConfiguration = repConf;
    }

    setDialogContents(loadedConfiguration);

    formValidator.setEnabled(true);
    formValidator.handleValidate();
    setModal(true);
    SwingUtil.centerDialogInParent(this);
    setVisible(true);
    if (isConfirmed() == false)
    {
      this.guiContext = defaultContext;
      return false;
    }

    formValidator.setEnabled(false);

    final Configuration fullDialogContents = grabDialogContents(true);
    final Enumeration configProperties =
        fullDialogContents.getConfigProperties();
    while (configProperties.hasMoreElements())
    {
      final String key = (String) configProperties.nextElement();
      repConf.setConfigProperty(key, fullDialogContents.getConfigProperty(key));
    }

    if (inputStorageEnabled)
    {
      saveToConfigStore(reportJob, repConf);
    }

    formValidator.setEnabled(true);
    this.reportJob = null;
    this.guiContext = defaultContext;
    return true;
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.modules.gui.commonswing.FormValidator

    pack();
    clear();
    initializeFromJob(reportJob, guiContext);
    createParametersPanelContent();

    final FormValidator formValidator = getFormValidator();
    formValidator.setEnabled(false);
    final ModifiableConfiguration repConf = reportJob.getReportConfiguration();
    final boolean inputStorageEnabled = isInputStorageEnabled(repConf);

    final Configuration loadedConfiguration;
    if (inputStorageEnabled)
    {
      loadedConfiguration = loadFromConfigStore(reportJob, repConf);
    }
    else
    {
      loadedConfiguration = repConf;
    }

    setDialogContents(loadedConfiguration);

    formValidator.setEnabled(true);
    formValidator.handleValidate();
    setModal(true);
    LibSwingUtil.centerDialogInParent(this);
    setVisible(true);
    if (isConfirmed() == false)
    {
      this.guiContext = defaultContext;
      return false;
    }

    formValidator.setEnabled(false);

    final Configuration fullDialogContents = grabDialogContents(true);
    final Enumeration configProperties =
        fullDialogContents.getConfigProperties();
    while (configProperties.hasMoreElements())
    {
      final String key = (String) configProperties.nextElement();
      repConf.setConfigProperty(key, fullDialogContents.getConfigProperty(key));
    }

    if (inputStorageEnabled)
    {
      saveToConfigStore(reportJob, repConf);
    }

    formValidator.setEnabled(true);
    this.reportJob = null;
    this.guiContext = defaultContext;
    return true;
  }
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.