You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joose Vettenranta <jo...@iki.fi> on 2004/07/24 16:29:11 UTC

cforms binding almost working

Hi,

I was able to get stuff from database and then make as cforms..

So this works:

         bean.setName ('Dad 1');
         child = new Packages.net.vettenranta.Child ();
         child.setName ('Child 1');
         bean.addChild (child);
         form.load(bean);
         form.showForm("forms/edit.html");
         form.save(bean);
         dao.insert (bean, factory);

But this does not:

	bean.setId (id);
	bean = dao.retrieve (bean, factory);
	form.load(bean);
	form.showForm("forms/edit.html");
	form.save(bean);
	dao.update (bean, factory);

What happens when doing this?

Every repeater-row element is INSERTed again, like CForms thinks that 
all of those are new childs. If I remove those rows, nothing will 
happen to them, only the ones which were left, was INSERTed.

I have tested with a script that this works: 
http://joose.iki.fi/ojb/#test

On that same url there is also binding file I used. But not the 
javascript I used to test forms, but it's showed on this mail.

Thanks,

Joose

--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *


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


Re: cforms binding almost working

Posted by Joose Vettenranta <jo...@iki.fi>.
24.7.2004 kello 17:29, Joose Vettenranta kirjoitti:

  Hi,
>
> I was able to get stuff from database and then make as cforms..
>
> So this works:
>
>         bean.setName ('Dad 1');
>         child = new Packages.net.vettenranta.Child ();
>         child.setName ('Child 1');
>         bean.addChild (child);
>         form.load(bean);
>         form.showForm("forms/edit.html");
>         form.save(bean);
>         dao.insert (bean, factory);
>
> But this does not:
>
> 	bean.setId (id);
> 	bean = dao.retrieve (bean, factory);
> 	form.load(bean);
> 	form.showForm("forms/edit.html");
> 	form.save(bean);
> 	dao.update (bean, factory);
>
> What happens when doing this?
>
> Every repeater-row element is INSERTed again, like CForms thinks that 
> all of those are new childs. If I remove those rows, nothing will 
> happen to them, only the ones which were left, was INSERTed.
>
> I have tested with a script that this works: 
> http://joose.iki.fi/ojb/#test
>
> On that same url there is also binding file I used. But not the 
> javascript I used to test forms, but it's showed on this mail.
>
> Thanks,
>
> Joose
>
> --
> "Always remember that you are unique, just like everyone else!"
> * http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *


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