Re: [xsl] passing parameters between pages

Subject: Re: [xsl] passing parameters between pages
From: James Fuller <jim.fuller@xxxxxxxxxxxxxx>
Date: Wed, 30 Nov 2005 10:06:12 +0100
Oleg Konovalov wrote:

>Hi,
>
>
>I need to pass a set of checkboxes (array of Strings) from one web page
>to the next.
>
>On screen1 I have a lot of DB rows displayed,
>each has a checkbox, all of them have the same name (v1),
>but different "value"s:
><input name="v1" type="checkbox">
>  <xsl:attribute name='value'><xsl:value-of
>select='$therow/memberId'/>
>  </xsl:attribute>
></input>
>
>If user selects a bunch of them and I do in the same action
>class:
>String [] members = request.getParameterValues("v1");
>I will get a bunch of values in array of strings,
>so I am able to do some DB operation on all of them.
>
>However, I need to pass that array of Strings
>as a parameter to the next screen (screen2),
>which is supposed to display detailed screen (all columns)
>of that row and allow me to modify it,
>So I need to pass in to the action class of screen2.
>
>I am trying to pass it there, so I can implement a page
>iteration
>(of screen2 pages) through the list of rows selected via
>checkboxes on screen1.
>
>In that action class of page2 I am trying to do:
>redirector.redirect(true, "screen2?memberId=nextId");
>
>(Using it on Cocoon 2.0.4 application with sitemap actions,
>but that probably shouldn't matter)
>I think it might be possible to do page iteration via sitemap,
>but have no idea how to do it. Is there conditional loop
>in sitemap ?
>
>Is it possible to make that array of Strings "global"
>(accessible from any XSL page like screen2) ?
>  
>

if I underestand your question correctly you would like to enable some
sort of statefullness e.g. simply pass vars from one page to the next

>Or pass it as request parameters ?  Or in Javascript ?
>
>  
>
XSLT has the concept of xsl:params to achieve this;  though how when can
inject a parameter into a transform is completely dependent on the XSLT
processing environment; so you need to configure specifically for
cocoon....I did this some years ago...so it may all be different today.

so.....I think this is done by editing your cocoon map document for your
cocoon app...somewhere there will be a map:transformer element(s)....u
need to indicate to pass HTTP GET params to xsl process....

     <map:parameter name="use-request-parameters" value="true"/>

this will instruct cocoon to pass any parameters passed in the URL to the XSLT process, for your xslt to take advantage of them u of course
need xsl:param definitions.

gl, Jim Fuller

Current Thread