cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carmona Perez, David" <DPerez...@fcc.es>
Subject RE: Woody custom validation
Date Thu, 06 Nov 2003 16:33:26 GMT
Another issue,
 
While in the provided example form.isValid is called?
Isn't always the form valid when showForm() returns?
 
function form1(form) {
    var locale = determineLocale();
    var model = form.getModel();
    model.email = "bar@www.foo.com";
    model.somebool = true;
    model.account = 2;
    model.cowheight = 4;
    model.number1 = 1;
    model.number2 = 3;
    model.birthdate = new java.util.Date();
    
    model.contacts[0].firstname = "Jules";
    model.contacts[1].firstname =  "Lucien";
    model.contacts[2].firstname = "Chris";
    model.drinks = ["Jupiler", "Coca Cola"];
 
    form.locale = locale;
    form.showForm("form1-display-pipeline");
    print("submitId = " + form.submitId);
    if (form.isValid) {        <---------------------------------------------------------------------------------------------doubt
here
      print("visa=" + model.visa);  
    } else {
      print("Form is not valid");
    }
    // Store the form as a request attribute, as the view is not
    // flow-aware.
    cocoon.request.setAttribute("form1", form.getWidget());
    cocoon.sendPage("form1-success-pipeline");
}
--------
David
 
-----Mensaje original-----
De: Carmona Perez, David [mailto:DPerezCar@fcc.es]
Enviado el: jueves, 06 de noviembre de 2003 17:20
Para: Cocoon (E-mail)
Asunto: Woody custom validation
 
How can I do in flow script custom validation?, i.e.  validation that is very app specific
and Woody provided validations aren't enough.
The only solution I see is to make a custom version of woody.js.  Surely there must be something
easier.
--------
David
 

Mime
View raw message