Michal Stochmialek wrote:

Hello,

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:

bizData[Packages.org.apache.cocoon.forms.transformation.FormsPipelineConfig.CFORMSKEY] 
= 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

--
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }



Reply via email to