cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thors...@apache.org>
Subject Re: [cforms] binding to an element with namespaces fails.
Date Thu, 01 Sep 2005 12:17:00 GMT
Answering my own question:

On Thu, 2005-09-01 at 13:47 +0200, Thorsten Scherler wrote:
> Hi all,
> 
> I have a problem with the binding to elements that have a namespace
> declared.
> 
> I am using the dynamicrepeater example. 
> I saved the outcome of the example to a file
> form.save(doc);
> saveDocument(doc, "PATH_TO_SAVE_THE_FILE").
> 
> I then changed the example code a wee bit further by adding 
> form.load("URI_TO_DATA"); 
> before the 
> form.showForm("DYNAMICREPEATER");
> 
> I have now the form showing up with the values I used before (like I
> suspected).
> 
> When I change in the input file ("URI_TO_DATA"):
> <contracts xmlns="http://testing.com/">
> ...
> </contracts>
> then I do not see the preselection and cannot save the form anymore.
> 

If you do not use the standard namespace (xmlns="http://testing.com/")
but  xmlns:contracts="http://testing.com/" then it is working again.

Is this a bug that I cannot use the standard namespace?

salu2

> How can I have namespaces in the input data xml and still be able to see
> the preselection and save the form.
> 
> TIA for any tips or ideas.
> 
> BTW in nearly all the examples that I saw, there is the following flow
> [1]:
> form = new Form("DEFINITION");
> form.showForm("DYNAMICREPEATER");
> form.createBinding("DYNAMICREPEATER");
> 
> If you use here the form.load("URI_TO_DATA"); before the
> form.showForm("..."); you will get an exception, because you need to
> have a form definition first to bind your input stream to. That can be
> done with the following order [2]:
> form = new Form("DEFINITION");
> form.createBinding("DYNAMICREPEATER");
> form.load("URI_TO_DATA");
> form.showForm("DYNAMICREPEATER");
> 
> Why do we use [1] and not as default [2]? It took me some time to
> understand why my example was failing till I used [2].
> 
> salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message