All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sksamuel.jqm4gwt.form.JQMForm Maven / Gradle / Ivy

The newest version!
package com.sksamuel.jqm4gwt.form;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.InlineLabel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.UIObject;
import com.google.gwt.user.client.ui.Widget;
import com.sksamuel.jqm4gwt.JQMCommon;
import com.sksamuel.jqm4gwt.JQMContext;
import com.sksamuel.jqm4gwt.Mobile;
import com.sksamuel.jqm4gwt.form.elements.JQMFormWidget;
import com.sksamuel.jqm4gwt.form.validators.NotNullOrEmptyValidator;
import com.sksamuel.jqm4gwt.form.validators.Validator;

/**
 * @author Stephen K Samuel [email protected] 12 Jul 2011 21:36:02
 *         
* A {@link JQMForm} is a standard GWT panel that offers extra * functionality for quick building of input forms. The framework offers * built in validation and error reporting and simplified submission * processing. *
* Any {@link JQMSubmit} widgets that are added will be automatically * wired to submit this form. Alternatively, any widget can be set to * programatically submit the form by invoking submit(); */ public class JQMForm extends FlowPanel { /** For example icon can be added: "ui-icon-alert ui-btn-icon-left" **/ public static String globalValidationErrorStyles; private static final String STYLE_OK_VALIDATED = "jqm4gwt-fieldvalidated"; private static final String STYLE_ERRORCONTAIN = "jqm4gwt-errorcontain"; private static final String STYLE_ERROR_TYPE = "jqm4gwt-errortype-"; private static final String STYLE_FORM_REQUIRED = "jqm4gwt-form-required"; private static final String STYLE_FORM_VALIDATOR = "jqm4gwt-form-validator-"; private static final String JQM4GWT_ERROR_LABEL_STYLENAME = "jqm4gwt-error"; private static final String JQM4GWT_GENERAL_ERROR_LABEL_STYLENAME = "jqm4gwt-general-error"; /** The amount to adjust error scroll by so the error is not right at very top */ private static final int ERROR_SCROLL_OFFSET = 80; private final FlowPanel generalErrors = new FlowPanel(); private final List




© 2015 - 2024 Weber Informatics LLC | Privacy Policy