cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: template.jx - up to date?
Date Sun, 26 Sep 2004 12:06:41 GMT
Michal Stochmialek wrote:

>Could you tell me what's the status of template.jx?
>Can I use it with v1 Form.js?  v2?
>For a first look (and first tests) it can be used with v1:
>e.i. in macro form-template is:
><jx:set var="context_widget_" value="#{.}"/>
>but should be:
><jx:set var="context_widget_" value="#{CooconFormsInstance}"/>
>because in Form.js (in showForm function) is:
= this.form;
>Later unwrap() function is used on Java objects...
>Well... something's wrong. Is this file totally updated or
>only for other version of Form.js?

template.jx in its current state is designed to work speciffically with 
v2/Forms.js, as the relies on the fact that v2/Form.js publishes the 
form itself as the view's context object.

I personally don't like this behaviour, as it prevents passing other 
data than the form to the view, which can be very restrictive. If you 
consider the "current" Form.js (not v2 nor v3), the prototype of 
Form.showForm is the same as cocoon.sendPageAndWait().

I'm currently working on an updated version of these macros, where there 
is no automagical publication of top-level widgets as jx variables and 
where "current_widget_" becomes "currentWidget" that is publicly 
available, along with "form" which references the form defined by the 
enclosing ft:form-template.


Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

View raw message