Hi,
can anyone point me in the direction of any <fd:java /> validation examples? I have viewed the CustomBirthDateValidator but cannot find the widget form that ties it all together. Using _javascript_ I have a form which validates as follows:

    <fd:validation>
        <fd:_javascript_>
            var success = true;
            var newUserReg = new Packages.test.User();
            var username = widget.lookupWidget("username");
            var password = widget.lookupWidget("password");
           
            try {
               
                var checkUserTest = newUserReg.getUser(username.value, password.value);
               
                if (checkUserTest != null) {
                    cocoon.session.setAttribute("user", checkUserTest);
                }else{
                    username.setValidationError(new Packages.org.apache.cocoon.forms.validation.ValidationError("The username, password combination does not exist. Please enter another one.", false));
                    password.setValidationError(new Packages.org.apache.cocoon.forms.validation.ValidationError("The password, username combination does not exist. Please enter another one.", false));
                    success = false;
                }
            } catch (e) {
                    username.setValidationError(new Packages.org.apache.cocoon.forms.validation.ValidationError(e, false));
                    password.setValidationError(new Packages.org.apache.cocoon.forms.validation.ValidationError(e, false));
                    success = false;
            }

            return success;
        </fd:_javascript_>
    </fd:validation>

How would I convert this from <fd:_javascript_ /> to <fd:java />? Can I declare variables, instantiate objects etc etc within the fd:java tag?

Andrew


Reply via email to