You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Dusane, Sachinkumar" <sa...@capgemini.com> on 2007/06/15 08:24:59 UTC

Help On Cocoon CForms

Hi,

 

I am currently trying to use Cocoon and found it very interesting.

 

But there are some queries on which I need some clarification.

 

1>How to use the data entered by user on CForms in the related Cocoon
Action.

2>How to pass data retrieved from database in Cocoon Action to CForms.

 

Hoping for positive reply.

 

Thanks
Sachin Dusane

Project Lead

CapGemini Consulting Ltd

Mumbai.

 



This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.

Re: Help On Cocoon CForms

Posted by Giuseppe Di Pierri <gi...@gmail.com>.
Hi  Sachin Dusane

On 15/06/07, Dusane, Sachinkumar <sa...@capgemini.com> wrote:
>
> Hi,
>
> I am currently trying to use Cocoon and found it very interesting.
>

very well, welcome on board!

> But there are some queries on which I need some clarification.
>
> 1>How to use the data entered by user on CForms in the related Cocoon Action.
>

AFAIK, it is not a suggested practice to use CForm with the cocoon actions.
It is relative simple to use CForm throughout javascript flow (I use
this) or java flow.
Why don't you try with it? See the samples, in that case.

> 2>How to pass data retrieved from database in Cocoon Action to CForms.
>

The binding part of CForm framework is borne to exchange data (POJO or
XML Doc.) with the form Model. So ideally you can proceed this way:

1. you make the query on the db (1)
2. and set the data into a POJO (hey, Hibernate will do this for you,
if you like) (1)
3. load (bind) the POJO into a predefined (using definition) model of a form (2)
4. let the user manipulate the data (at libitum) (3)
5. save (bind) the manipulated data in the model of the form into your POJO (2)
6. finally you save back the POJO information into the database (1)

That's it.

(1) This could be done a class that respond to DAO pattern
(2) You do this in the javascript flow
(3) This is a gift by CForm

> Hoping for positive reply.
>

Any reply could be positive, if you want to ;-)
I hope this can help.

Regards
pino

-- 
Giuseppe Di Pierri
Managing Director
______________________
Phiware Engineering Sagl
via Ginevra 5
CH-6900 Lugano
Tel. +41 91 260 75 55
Fax.+41 91 260 75 59
Email. giuseppe.dipierri@phiware.ch
--

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