cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Oliver <res1c...@verizon.net>
Subject Re: [Woody] observations, issues, questions, best practices
Date Mon, 19 Jan 2004 20:47:16 GMT
Joerg Heinicke wrote:

> Hello,
>
> at work I may convert a Struts application into a Woody one. I played 
> around with the Woody samples and created a form handling prototype 
> for my application. But I came across some problems and made some 
> observations I want to point out here. On the other hand the 
> architecture is not "fixed", especially the communication with the 
> backend, so the handling of the business logic is not that perfect.
>
> 1. When the template contains a reference to a not defined widget, I 
> get an exception: "EffectWoodyTemplateTransformer: Widget with id 
> "addcontact" does not exist in the container."
> What would be helpful in this error message is the mentioning of the 
> file and the line number.
>
> 2. When a flow script function is not available (called via woody2.js, 
> line 213) I only get a "CascadingRuntimeException: The undefined value 
> has no properties." Isn't it possible to give a more exact explanation 
> or at least to point to the expression that returns undefined?

You could change the code to this:

function woody(form_function, form_definition) {
    var form = new Form(cocoon.parameters["form-definition"]);
   
    var args = [form];

    // set the binding on the form if there's any
    var bindingURI = cocoon.parameters["bindingURI"];
    if (bindingURI != null)
        form.createBinding(bindingURI);
    var funName = cocoon.parameters["function"];
    var fun = this[funName];
    if (!fun) {
      throw "Function \""+funName +"\" is not defined";
    } else if (!(fun instanceof Function)) {
      throw "\""+funName +"\" is not a function";
    }
    fun.apply(this, args);
}


Mime
View raw message