cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Portier <...@outerthought.org>
Subject Re: Further information needed on cform binding
Date Tue, 08 May 2007 08:22:40 GMT


Dev at weitling wrote:
> Hi folks,
> 
> I want to reach the higher level of cform binding zen, but can't find
> enough information.
> The questions bothering me are at least:
> - What does e.g. <fb:value id="id" path="@id"/> mean? Does it make any
> sense in Java-binding?

Java binding?

the cforms 'binding' actually is just an XML shorthand to express how
the widget-structure or form-model (see form-definition) maps onto the
actuall business-model (java objects or xml files)


> - The path attribute always maps to a member or a get/set-style method
> of a bean. What if I have a method name in other style e.g. list() or
> iterator()? What if I have a method which needs an argument?

in case of collections on the business side, then you probably will end
up with some kind of repeater inside your form, you could use the
fb:repeater to express the mapping between them

in more general terms, you can use the fb:java or fb:javascript to
express more freely how certain sub-contexts should be mapped

and if that is not enough: you can not use binding and just manually
transfer between form-widgets and back-end API calls

(note that the binding is intended as a _shorthand_ for such back-end
mapping: as soon as it stops being shorter, you _should_ switch to
something else!)

> - Imagine I have an object containing three lists: The first holds
> information which key items are displayed and in which order. The others
> have data handled by two repeaters which should display according to the
> order of their keys in the first list. I have a knot in my brain till now...
> - How to do it when I have a HashMap (key -> data) and I want to display
> the keys as well as their data?

dunno by heart, but from memory I would guess the fb:repeater's nested
fb:identity should be used to map the key

see
http://cocoon.zones.apache.org/daisy/cdocs/g1/g2/g7/forms/binding/488.html

have you checked the binding samples?  none of them have something on
hashmaps?

regards,
-marc=

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


Mime
View raw message