Package com.smartgwt.client.widgets.form.validator

Examples of com.smartgwt.client.widgets.form.validator.RequiredIfValidator


        radioGroupItem.setTitle("Will you be attending the meeting on April 4th? If no, please provide a reason");

        TextItem textItem = new TextItem();
        textItem.setName("reason");
        textItem.setTitle("Reason");
        RequiredIfValidator ifValidator = new RequiredIfValidator();
        ifValidator.setExpression(new RequiredIfFunction() {
            public boolean execute(FormItem formItem, Object value) {
                String valueStr = (String) radioGroupItem.getValue();
                return "No".equals(valueStr);
            }
        });
        ifValidator.setErrorMessage("Please provide a reason");

        textItem.setValidators(ifValidator);

        ButtonItem buttonItem = new ButtonItem("validate", "Validate");
        buttonItem.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.form.validator.RequiredIfValidator

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.