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/11/20 09:54:16 UTC

[SOLVED] cforms + binding to array

Hi,

testing and trying and I solved it..

path=".[index]" and index starts from 1 not from 0.

- Joose

20.11.2004 kello 01:33, Joose Vettenranta kirjoitti:

  Hi,
>
> I have a bean which has Collection items;
>
> and then I have a String[] values = new String[3]; and then I have 
> this.items.add(values);
>
> but how in CForms can I bind to different index of the String-array?
>
>   <fb:repeater id="items" parent-path="." row-path="items">
>     <fb:identity>
>       <fb:value id="id" path="[0]"/>
>     </fb:identity>
>
>     <fb:on-bind>
>       <fb:value id="id" path="[0]"/>
>       <fb:value id="name" path="[1]"/>
>       <fb:value id="value" path="[2]"/>
>    </fb:on-bind>
> </fb:repeater>
>
> Would that work? most likely not.. how could it be made to work or is 
> it impossoble to bind to a index of an array?
>
> 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


Re: [NOT SOLVED] [SOLVED] cforms + binding to array

Posted by Joose Vettenranta <jo...@iki.fi>.
Aaand answering to myself again.. I think it did work, but my test 
class was broken.. =)

- Joose

20.11.2004 kello 15:26, Joose Vettenranta kirjoitti:

  Hi,
>
> well, I got it to READ values, but I can't make it to SAVE those 
> values.. Anyideas how to accomplish that?
>
> If I make class="java.lang.String" it saves just same as saving 
> String[].class;
>
> class="java.lang.String[]" -> does not work
>
> and addItem (String value) -> addItem(Object value) { String[] 
> newValue = (String[]) value; .. } does not work eather.
>
> Ideas?
>
> Thanks,
>
> Joose
>
> 20.11.2004 kello 10:54, Joose Vettenranta kirjoitti:
>
>  Hi,
>>
>> testing and trying and I solved it..
>>
>> path=".[index]" and index starts from 1 not from 0.
>>
>> - Joose
>>
>> 20.11.2004 kello 01:33, Joose Vettenranta kirjoitti:
>>
>>  Hi,
>>>
>>> I have a bean which has Collection items;
>>>
>>> and then I have a String[] values = new String[3]; and then I have 
>>> this.items.add(values);
>>>
>>> but how in CForms can I bind to different index of the String-array?
>>>
>>>   <fb:repeater id="items" parent-path="." row-path="items">
>>>     <fb:identity>
>>>       <fb:value id="id" path="[0]"/>
>>>     </fb:identity>
>>>
>>>     <fb:on-bind>
>>>       <fb:value id="id" path="[0]"/>
>>>       <fb:value id="name" path="[1]"/>
>>>       <fb:value id="value" path="[2]"/>
>>>    </fb:on-bind>
>>> </fb:repeater>
>>>
>>> Would that work? most likely not.. how could it be made to work or 
>>> is it impossoble to bind to a index of an array?
>>>
>>> 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
>>
>>
> --
> "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


Re: [NOT SOLVED] [SOLVED] cforms + binding to array

Posted by Joose Vettenranta <jo...@iki.fi>.
Hi,

well, I got it to READ values, but I can't make it to SAVE those 
values.. Anyideas how to accomplish that?

If I make class="java.lang.String" it saves just same as saving 
String[].class;

class="java.lang.String[]" -> does not work

and addItem (String value) -> addItem(Object value) { String[] newValue 
= (String[]) value; .. } does not work eather.

Ideas?

Thanks,

Joose

20.11.2004 kello 10:54, Joose Vettenranta kirjoitti:

  Hi,
>
> testing and trying and I solved it..
>
> path=".[index]" and index starts from 1 not from 0.
>
> - Joose
>
> 20.11.2004 kello 01:33, Joose Vettenranta kirjoitti:
>
>  Hi,
>>
>> I have a bean which has Collection items;
>>
>> and then I have a String[] values = new String[3]; and then I have 
>> this.items.add(values);
>>
>> but how in CForms can I bind to different index of the String-array?
>>
>>   <fb:repeater id="items" parent-path="." row-path="items">
>>     <fb:identity>
>>       <fb:value id="id" path="[0]"/>
>>     </fb:identity>
>>
>>     <fb:on-bind>
>>       <fb:value id="id" path="[0]"/>
>>       <fb:value id="name" path="[1]"/>
>>       <fb:value id="value" path="[2]"/>
>>    </fb:on-bind>
>> </fb:repeater>
>>
>> Would that work? most likely not.. how could it be made to work or is 
>> it impossoble to bind to a index of an array?
>>
>> 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
>
>
--
"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