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 2005/06/30 15:45:31 UTC

Forms problem: repeater and adding rows

Hi,

in binding file when using beans adding is bind like this:

    <fb:on-insert-row>
       <fb:insert-bean classname="my.nice.Item" addmethod="addItem"/>
    </fb:on-insert-row>

but can that be written in javascript for flow or should I just  
modify the bean to setup files correctly on addItem command? Like:
<fb:on-insert-row>
  <javascript>
    var bean = new Bean();
    bean.setValue("foo");
    return bean;
  </javascript>
</fb:on-insert-row>

and then when adding new row value would always be "foo".

Basic problem is this: I need to setup default values for the item.

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: Forms problem: repeater and adding rows

Posted by Ben Pope <be...@gmail.com>.
Joose Vettenranta wrote:
> Hi,
> 
> in binding file when using beans adding is bind like this:
> 
>    <fb:on-insert-row>
>       <fb:insert-bean classname="my.nice.Item" addmethod="addItem"/>
>    </fb:on-insert-row>
> 
> but can that be written in javascript for flow or should I just  modify 
> the bean to setup files correctly on addItem command? Like:
> <fb:on-insert-row>
>  <javascript>
>    var bean = new Bean();
>    bean.setValue("foo");
>    return bean;
>  </javascript>
> </fb:on-insert-row>
> 
> and then when adding new row value would always be "foo".
> 
> Basic problem is this: I need to setup default values for the item.

How default are they?  Can you not do it in the constructor of the bean?

Ben

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