You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Eirik Bjørsnøs <bj...@stud.ntnu.no> on 2004/11/17 17:29:14 UTC

[PATCH] Loading a form from a DOM tree

> Eirik Bjørsnøs wrote:
>
>>
>> Hello Cocoon developers,
>>
>> Would it be possible to load a form from a DOM tree instead of from a 
>> uri using the javascript flow api?
>
> Well, if FormManager already supports it, I see no problem in exposing 
> it in the Form JS object.
>
> Sylvain

Sylvain,

The attatched patch for Form.js checks the type of the parameter in 
function/constructor Form(uriOrElement).

If uriOrElement is an instance of org.w3c.dom.Element, the form is 
loaded directly from the element. If not, it is loaded from the uri as 
before. The type checking is done using instanceof.

I'm quite new to Javascript, so you can probably think of better ways 
to solve this. But I've tested it and it works. It's very useful since 
I'm creating a multiform wizard but want to keep all the forms in the 
same xml.

Is there any possibility for this to be included in 2.1.6? (It's just a 
small fix, and shouldn't break existing code, but then again, smarter 
people than me have said that before and got burned :-)


Re: [PATCH] Loading a form from a DOM tree

Posted by Joerg Heinicke <jo...@gmx.de>.
On 17.11.2004 17:29, Eirik Bjørsnøs wrote:

> Is there any possibility for this to be included in 2.1.6? (It's just a 
> small fix, and shouldn't break existing code, but then again, smarter 
> people than me have said that before and got burned :-)

I don't think so as we are already in code freeze phase where only 
patches should be applied, no enhancements. Adding it needs a formal 
vote from the committers.

Joerg