Package org.gwtoolbox.widget.client.form.field

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


     *
     * @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

     * @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

     * @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

TOP

Related Classes of org.gwtoolbox.widget.client.form.field.FormField

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.