cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist ...@wrinkledog.com>
Subject Re: [CForms] Howto?: bind repeater to collection of String
Date Tue, 18 Jul 2006 13:34:49 GMT

Hi Simone, thx for the reply...

On Jul 18, 2006, at 3:14 AM, Simone Gianni wrote:

> <snip...>
>> 1) What is the deal with row deletion? Apparently when binding to an
>> XML tree, you have to say
>>
>> <fb:on-delete-row>
>> 	<fb:delete-node/>
>> </fb:on-delete-row>
>>
>> if you want the delete row-action to do anything. Why? And don't you
>> have to do anything special in the binding to make delete work when
>> you are binding to a Collection? If so, what?
>
> The default behaviour when no on-delete-row is specified is to use
> JXPath "node" deletion, which actually should remove the item from the
> collection... as long as the collection is a List it usually works.

Hmm, coming back to this today I noticed that I am also getting this 
warning in the log:

	RepeaterBinding has detected rows to delete, but misses the 
<on-delete-row> binding to do it.

???

>>
>> 2) What's the deal with row insertion? I get this warning in the log
>>
>> RepeaterJXPathBinding: RepeaterBinding has detected rows to insert,
>> but misses the <on-insert-row> binding to do it.
>>
>> OK, I get it... for a bean, we need to register a factory so that the
>> binding will know how to create the new thing. Fair enough. But I've
>> been looking at the documentation
>> (http://cocoon.apache.org/2.1/userdocs/binding.html), and I don't get
>> it... how about an example? And anyway, I don't have a bean here. Just
>> a String. How do I make this work?
>
> You have to define a on-insert-row, containing an insert-bean, for 
> example :
>
> <fb:on-insert-row>
>   <fb:insert-bean ...>
> </fb:on-insert-row>

Yes, yes, I understand that much :-)... but I think an example of what 
the <fb:insert-bean> attributes might look like would help me to 
understand.

Note, I'm kind of trying for 2 different things here: (1) really 
understanding how repeater bindings work, and (2) getting my problem 
solved one way or the other :-).  That is why I'm asking all these 
questions that may not seem related :-).

>
> The insert bean requires a class and method, the method is referred to
> the context bean, so you need an addXXX method on you bean.

See above... how 'bout an example? :-)

>
> But all this will not solve your problem,

right... I know :-)

> this is because there is no
> way to tell to the repeater binding that the context bean and a field
> are the same (the fb:value with path="." that never works).
>
> I made many simlar pages (in one i have to fill a collection with beans
> taken from a list retrieved from a service method and displayed in drop
> downs), and i ended coding my own, super simple RepeaterToBeanList
> binding, which is quite similar to the simple repeater binding but
> actually fills the collection with beans (or any other object) taken
> from a field contained in the repeater.
>
> The code for this class follows, I'm working on this kind of problems
> and will hopefully come up with something intresting when I have time 
> to :(
>

Thanks a lot, I will take a look and see if I can figure it out... :-)

Best regards,
—ml—


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


Mime
View raw message