You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ra...@tcs.com on 2006/06/30 11:55:36 UTC

server side validation using cocoon flow script

Hi,

I'm using cocoon 2.1.8. I am using HTML form inside my XSL's. ( I could 
have used CForms, but at this moment it will be a bigger change for me, as 
I have to change at many places. Too late to make this change. ).

What I need :
In this case i'm accessing request parameters from the form inside flow 
script function. If any of them is empty i have to send it back pre-filled 
with other choices that user has entered. 
Ex.
If a form has 5 input fields, and user enters only first two then i have 
to show a error message alongwith already pre-filled choices 1 and 2

Here I'm able to validate and display the error message, but I can't show 
the page with pre-filled choices. 

Is there any way for doing this?
Any inputs and suggestions are welcome.

Thanks in advance,
Rahul
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



Re: server side validation using cocoon flow script

Posted by ar...@tcs.com.
Hi Rahul

I suppose you can do something like this:-

1. Have all the values of the fields as request parameters.
2. As you submit check the request parameters values at the xsl before 
populating the fields in the form.
3. If its empty then go for a call template where the javascript function 
currently being used does the validation        else populate the values 
in the fields of the form.


Regards,
Arnab


> Hi,
>
> I'm using cocoon 2.1.8. I am using HTML form inside my XSL's. ( I could
> have used CForms, but at this moment it will be a bigger change for me, 
as
> I have to change at many places. Too late to make this change. ).
>
> What I need :
> In this case i'm accessing request parameters from the form inside flow
> script function. If any of them is empty i have to send it back 
pre-filled
> with other choices that user has entered.
> Ex.
> If a form has 5 input fields, and user enters only first two then i have
> to show a error message alongwith already pre-filled choices 1 and 2
>
> Here I'm able to validate and display the error message, but I can't 
show
> the page with pre-filled choices.
>
> Is there any way for doing this?
> Any inputs and suggestions are welcome.
>
> Thanks in advance,
> Rahul
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



Re: server side validation using cocoon flow script

Posted by Tuomo L <tl...@cc.hut.fi>.
Check out JXTemplateTransformer. Here's the doc for the 
generator-implementation, but the transformer works the same way.

You can then put in your HTML something like: <input name="firstname" 
type="text" 
value="${cocoon.request.firstname}"/>

and run this document through JXTemplateTransformer. the fields will then 
populate with the data user has provided.

-Tuomo

On Fri, 30 Jun 2006 rahul.manavi@tcs.com wrote:

> Hi,
>
> I'm using cocoon 2.1.8. I am using HTML form inside my XSL's. ( I could
> have used CForms, but at this moment it will be a bigger change for me, as
> I have to change at many places. Too late to make this change. ).
>
> What I need :
> In this case i'm accessing request parameters from the form inside flow
> script function. If any of them is empty i have to send it back pre-filled
> with other choices that user has entered.
> Ex.
> If a form has 5 input fields, and user enters only first two then i have
> to show a error message alongwith already pre-filled choices 1 and 2
>
> Here I'm able to validate and display the error message, but I can't show
> the page with pre-filled choices.
>
> Is there any way for doing this?
> Any inputs and suggestions are welcome.
>
> Thanks in advance,
> Rahul
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>

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


Re: server side validation using cocoon flow script

Posted by Tuomo L <tl...@cc.hut.fi>.
..and here's the doc: 
http://cocoon.apache.org/2.1/userdocs/flow/jxtemplate.html

-Tuomo

On Fri, 30 Jun 2006 rahul.manavi@tcs.com wrote:

> Hi,
>
> I'm using cocoon 2.1.8. I am using HTML form inside my XSL's. ( I could
> have used CForms, but at this moment it will be a bigger change for me, as
> I have to change at many places. Too late to make this change. ).
>
> What I need :
> In this case i'm accessing request parameters from the form inside flow
> script function. If any of them is empty i have to send it back pre-filled
> with other choices that user has entered.
> Ex.
> If a form has 5 input fields, and user enters only first two then i have
> to show a error message alongwith already pre-filled choices 1 and 2
>
> Here I'm able to validate and display the error message, but I can't show
> the page with pre-filled choices.
>
> Is there any way for doing this?
> Any inputs and suggestions are welcome.
>
> Thanks in advance,
> Rahul
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>

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


RE: server side validation using cocoon flow script

Posted by Geert Josten <ge...@daidalos.nl>.
Pass the request parameters to your XSL and insert these as the
'initial' value of the input fields. You need a few steps to achieve
this:
 - either call the xsl with:
	<map:transform src="mytemplate.xsl">
	  <map:parameter name="use-request-parameters" value="true" />
      </map:transform>
   or pass each request-param as a separate parameter to the XSL call.
 - define an <xsl:param name="my_request_param" /> for each of the
request parameters in your XSL
 - define the input fields in your XSL like for instance: <input
type="text" value="{$my_request_param}" />

The request-parameters should boil through from initial request to the
pipeline called with sendPage(AndWait)..

Kind regards,
Geert

> 
   
 
Drs. G.P.H. Josten
Consultant
 
 

Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl


De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.
 

> Van: rahul.manavi@tcs.com [mailto:rahul.manavi@tcs.com] 
> Verzonden: vrijdag 30 juni 2006 11:56
> Aan: users@cocoon.apache.org
> Onderwerp: server side validation using cocoon flow script
> 
> 
> Hi, 
> 
> I'm using cocoon 2.1.8. I am using HTML form inside my XSL's. 
> ( I could have used CForms, but at this moment it will be a 
> bigger change for me, as I have to change at many places. Too 
> late to make this change. ). 
> 
> What I need : 
> In this case i'm accessing request parameters from the form 
> inside flow script function. If any of them is empty i have 
> to send it back pre-filled with other choices that user has entered. 
> Ex. 
> If a form has 5 input fields, and user enters only first two 
> then i have to show a error message alongwith already 
> pre-filled choices 1 and 2 
> 
> Here I'm able to validate and display the error message, but 
> I can't show the page with pre-filled choices. 
> 
> Is there any way for doing this? 
> Any inputs and suggestions are welcome. 
> 
> Thanks in advance,
> Rahul
> =====-----=====-----=====
> Notice: The information contained in this e-mail message 
> and/or attachments to it may contain confidential or 
> privileged information. If you are not the intended 
> recipient, any dissemination, use, review, distribution, 
> printing or copying of the information contained in this 
> e-mail message and/or attachments to it are strictly 
> prohibited. If you have received this communication in error, 
> please notify us by reply e-mail or telephone and immediately 
> and permanently delete the message and any attachments. Thank you
> 
> 
>

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