cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Hermann <christoph.herm...@guschtel.de>
Subject Re: How to load form using request parameter
Date Thu, 08 Dec 2005 09:20:06 GMT
Wim.Mosman@mediacenter.nl schrieb:

Hello,

> I'm have a problem with making a form for editing an XML file using cform.
> We have an XML file called users.xml which looks like this:
> <users>
>   <user id=1>
>     ...
>   </user>
>   <user id=2>
>     ...
>   </user>
>   ..
> </users>
> 
> I succeeded in making an editable tabel, using de repeater widgets etc. But
> what I want is making a form for editing one single user at the time / in
> one screen..
> Therefore I changed de model, template and binding XML file (removing
> repeater items).
> The probleem now is that always the user with id=1 is being loaded
> (updating this one works fine by the way).
> How can we load a user tag voor a specific user id, which value is in a
> request Parameter ( ../user.flow?userid=2 )?

Just adapt your (jx-)binding file:

<fb:context
xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"
xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
path="/users/user[@id='${parameters.getParameter('userid')}']">
<fb:value id="username" path="username" />
...
</fb:context>

HTH
Christoph

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


Mime
View raw message