cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Sparkes <pe...@didm.co.uk>
Subject Re: CForms - Binding to one of Multiple Records - solved
Date Sun, 14 May 2006 16:12:34 GMT
Sorry about the delay in replying - I have been away.

Thanks you Ben for providing the solution to my problem and my  thanks 
also to  all who sent me helpful suggestions.

Peter Sparkes

> On 29/04/06, Peter Sparkes <peter@didm.co.uk> wrote:
>
>> Hi Ben,
>>
>> Thank you - but I don't know how to get the "recordId" from the pipeline
>> into the binding document. Can you please help
>
>
>
> If your binding starts like:
> <?xml version="1.0"?>
> <fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"
>            path="/records">
>
>
> And you had an xsl that looked like:
> <?xml version="1.0"?>
> <xsl:transform version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:fb="http://apache.org/cocoon/forms/1.0#binding">
>   <xsl:param name="recordId"/>
>
>   <xsl:template match="/fb:context/@id">
>      <fb:value id="/recoreds/record[@id={$recordId}"/>
>   </xsl:template>
> ...
>
>
> And served that through a pipeline:
>
> <map:call function="ShowForm">
>   <map:parameter name="recordId" value="{request-param:recordId}"/>
> ...
>
>
> And ShowForm had:
>
> function ShowForm() {
>    var recordId = cocoon.parameters.recordId;
>    cocoon.request.setAttribute("recordId", recordId);
>
>    var form = new Form("FormDefinition.xml");
>
>    form.createBinding("cocoon:/MyFormBindingURI");
>
> ...
>
>
> I think that's all the bits you need, should get you started!
>
>
> Ben Pope
> -- 
> I'm not just a number. To many, I'm known as a string...


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


Mime
View raw message