cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markx.John...@rrd.com
Subject Re: Problem binding Woody form to Map entries in Bean
Date Tue, 27 Apr 2004 18:32:46 GMT
Thanks Joerg,

That worked fine for populating the form with values.  The jury is still 
out on whether the changed values are getting back into the bean.  Some 
problems I need to track down in the java code.  No Exception on the 
form.save(bean) though.

Thanks

Mark





Joerg Heinicke <joerg.heinicke@gmx.de>
04/27/2004 12:07 PM
Please respond to users

 
        To:     users@cocoon.apache.org
        cc: 
        Subject:        Re: Problem binding Woody form to Map entries in Bean


On 27.04.2004 18:18, Markx.Johnson@rrd.com wrote:

> Hi,
> 
> I am having a problem I hope someone can help me with.  I have a Bean 
with 
> a Map of metadata in it and I want to be able to create a Woody form to 
> update the metadata.  The Map keys are all strings and there is a 
> getMetaData(String key) method.
> I have been able to bind to Map entries with:
> 
>         <value id="foo" path="./metaData/foo"/>
> 
> The problem is some of the Map key strings have spaces in them.  For 
> example
> 
>         <value id="foo" path="./metaData/Creation Date"/>
> 
> Which results in a JXPathException due to an invalid XPath.
> 
> Can anybody suggest how I can make this work?

http://jakarta.apache.org/commons/jxpath/users-guide.html#Map%20Element%20Access

alternative syntax:

"addresses[@name='home']/zipCode"

So for your example it would probably be

<value id="foo" path="./metaData[@name = 'Creation Date']"/>

But no guarantee that this also works on saving the value back to the 
bean. Try it out if you get a JXPathException then too.

Joerg

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




Mime
View raw message