You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Mark Lundquist <ml...@wrinkledog.com> on 2005/06/21 17:41:25 UTC

v2 (was Re: [CForms binding] access to model data from repeater row widget)

On Jun 20, 2005, at 11:42 PM, Sylvain Wallez wrote:

> BTW, why do you prefer v2 rather than v1?

Honestly I can't remember ATM... :-)

I switched a long time ago because (a) I was under the impression that 
v2 was where the form API was headed, and (b) more importantly, there 
were specific things that I could do in v2 and not in v1.  I think the 
the clincher had to do with actions, and being able to access something 
or other from within the action callback, or something.  Like I said, I 
switched long enough ago that I can't remember now in terms of "can't 
do that in v1" things.

I'm actually using a custom extension to Form that encapsulates a 
standard usage model that I've settled on, mostly naming and locations 
of things.  And I based that on v2, so for the time being I've stuck 
myself with it :-)

—ml—


Re: v2 (was Re: [CForms binding] access to model data from repeater row widget)

Posted by Sylvain Wallez <sy...@apache.org>.
Mark Lundquist wrote:

> Hey, this morning I remembered what started me down the v2 path, as I  
> was replying to a guy on the users' list.  It was that in v2, I can 
> set  someWidget.onValidate to a function that is nested inside the 
> form  controller flowscript function, where it can access that 
> function's  local variables.  (Here's that mail:  
> http://marc.theaimsgroup.com/?l=xml-cocoon- 
> users&m=111954841402175&w=2... I mention a way that might work in v1  
> that I hadn't thought of until today as I was composing that!)


Ah yes. I'll add this to V1 as well.

Sylvain


-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Re: v2 (was Re: [CForms binding] access to model data from repeater row widget)

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jun 23, 2005, at 2:25 AM, Sylvain Wallez wrote:

>> One thing I don't care so much for in v2 is the idiom of attaching  
>> view data as properties of the widget tree root.  The minimalist  
>> approach (losing 'bizData') was clever, but in actual practice I find  
>> that I really like having one locus of transfer of data between the  
>> flowscript and the presentation, so I usually end up with something  
>> like this anyway:
>>
>>     w.viewData =
>>         {
>>             schtuff:     foobar,
>>             etc:        otherStuff
>>         };
>>     form.showForm ('whatev');
>
> Uh? Didn't knew about that, and looks hacky IMO.

Ex-hacktly! :-)

>>     BTW, why do you prefer v2 rather than v1?

Hey, this morning I remembered what started me down the v2 path, as I  
was replying to a guy on the users' list.  It was that in v2, I can set  
someWidget.onValidate to a function that is nested inside the form  
controller flowscript function, where it can access that function's  
local variables.  (Here's that mail:  
http://marc.theaimsgroup.com/?l=xml-cocoon- 
users&m=111954841402175&w=2... I mention a way that might work in v1  
that I hadn't thought of until today as I was composing that!)

cheers,
—ml—


Re: v2 (was Re: [CForms binding] access to model data from repeater row widget)

Posted by Sylvain Wallez <sy...@apache.org>.
Mark Lundquist wrote:

>
> On Jun 21, 2005, at 8:41 AM, Mark Lundquist wrote:
>
>>
>> On Jun 20, 2005, at 11:42 PM, Sylvain Wallez wrote:
>>
>>> BTW, why do you prefer v2 rather than v1?
>>
>> <..schnip!..>
>
>
> One thing I don't care so much for in v2 is the idiom of attaching 
> view data as properties of the widget tree root.  The minimalist 
> approach (losing 'bizData') was clever, but in actual practice I find 
> that I really like having one locus of transfer of data between the 
> flowscript and the presentation, so I usually end up with something 
> like this anyway:
>
>     w.viewData =
>         {
>             schtuff:     foobar,
>             etc:        otherStuff
>         };
>     form.showForm ('whatev');


Uh? Didn't knew about that, and looks hacky IMO.

> ...and so I guess I'd rather have it as an explicit parameter (and 
> also not needing to have 'viewData.' at the head of the expression 
> path within the JX template).
>
> While on the subject... since I am "Mr. Anal Nomenclature Pants", I 
> would vote for changing 'bizData' to 'viewData' (as in v3)... a much 
> better name IMHO :-)


And I *totally* agree with you, as this data is exclusively prepared for 
and consumed by the view!

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Re: v2 (was Re: [CForms binding] access to model data from repeater row widget)

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jun 21, 2005, at 8:41 AM, Mark Lundquist wrote:

>
> On Jun 20, 2005, at 11:42 PM, Sylvain Wallez wrote:
>
>> BTW, why do you prefer v2 rather than v1?
> <..schnip!..>

One thing I don't care so much for in v2 is the idiom of attaching view 
data as properties of the widget tree root.  The minimalist approach 
(losing 'bizData') was clever, but in actual practice I find that I 
really like having one locus of transfer of data between the flowscript 
and the presentation, so I usually end up with something like this 
anyway:

	w.viewData =
		{
			schtuff:	 foobar,
			etc:		otherStuff
		};
	form.showForm ('whatev');

...and so I guess I'd rather have it as an explicit parameter (and also 
not needing to have 'viewData.' at the head of the expression path 
within the JX template).

While on the subject... since I am "Mr. Anal Nomenclature Pants", I 
would vote for changing 'bizData' to 'viewData' (as in v3)... a much 
better name IMHO :-)

cheers,
—ml—