cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Portier <...@outerthought.org>
Subject Re: Woody Bean Binding - load() works, save() doesn't
Date Fri, 16 Jan 2004 08:05:48 GMT


Phil Blake wrote:
> Hiya,
> 
> I have a binding that looks like this:
> 
> <wb:context path="/" wb="http://apache.org/cocoon/woody/binding/1.0">
> <wb:value id="kriEntry200" path="KRIEntries[oid=200]/numberValue" />
> <wb:value id="kriEntry201" path="KRIEntries[oid=201]/numberValue" />
> </wb:context>
> 
> The form.load() works fine and all the values are loaded into the widgets.
> 
> However the form.save() generates the following error:
> 
> (Ignorable) problem binding field kriEntry200
> org.apache.commons.jxpath.JXPathException: Cannot create a relative 
> context for a non-existent node: /KRIEntries[1]/numberValue
> done saving ValueJXPathBinding[widget=kriEntry200, 
> xpath=KRIEntries[oid=200]/numberValue] -- value=null -- on-update == true
> 
> (Ignorable) problem binding field kriEntry201
> org.apache.commons.jxpath.JXPathException: Cannot create a relative 
> context for a non-existent node: /KRIEntries[2]/numberValue
> done saving ValueJXPathBinding[widget=kriEntry200, 
> xpath=KRIEntries[oid=201]/numberValue] -- value=null -- on-update == true
> 
> The values are both updated to equal null.
> 
> If the binding can load, shouldn't they be able to save? Is there 
> anything mysterious about bean binding that could be going on here?

nope, I think this cannot work with XML either

it's a bid hard to guess based on the provided data, but my guess would 
be that jxpath is struggling with the [predicate] in the xpath

suggestion would be to move that [predicate] selection into a separate 
context-binding

pls, try this, and let me know how it worked out...

<wb:context path="/" wb="http://apache.org/cocoon/woody/binding/1.0">
   <wb:context path="KRIEntries[oid=200]/" >
     <wb:value id="kriEntry200" path="numberValue" />
   </wb:context>
   <wb:context path="KRIEntries[oid=201]/" >
     <wb:value id="kriEntry201" path="numberValue" />
   </wb:context>
</wb:context>

> Phil

regards,
-marc=
-- 
Marc Portier                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at                http://blogs.cocoondev.org/mpo/
mpo@outerthought.org                              mpo@apache.org


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


Mime
View raw message