cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject [Fwd: cform/ woody - event based filling of selection list]
Date Tue, 27 Apr 2004 13:04:11 GMT
Forwarding this message to dev@ to make sure Sylvain sees it.

The problem is events that are caused as a result of calling setValues
on widgets before the form is first displayed, are now executed
immediately, when the viewData isn't available yet (as that is only
specified when doing showForm).


Coincidentally, I was just looking at that while studying Form.js, and
found it strange that the eventlisteners/validators would have access to
viewData. viewData is data meant to be passed on the view. What we need
here is something different, 'formContextData' or something.

I propose that any context data that we want to make available to
eventlisteners (or validators for that matter) is separated from the
viewData. The user/developer may of course choose to simply use the same
object for that purpose.

In fact, maybe this 'formContextData' could simply be the attributes
that can be set on a form?

-----Forwarded Message-----
From: Joern Wallstabe <joern.wallstabe@igd-r.fraunhofer.de>
To: users@cocoon.apache.org
Subject: cform/ woody - event based filling of selection list
Date: Tue, 27 Apr 2004 14:29:36 +0000

Hello all,

I'm migrated from 
		cocoon 2.1.4 (dist)	 -> 	cocoon-2.1.5 (cvs)
			Woody 	-> CForm
			woody2.js -> Form.js		
and run into follwing problem.

At one time I'm trying to fill a selection list based on a 'change' event. 

form.showForm("view/editForm.cforms", {
	    		myList:myList			
 });


<fd:on-value-changed>
	    <javascript>
		....
		var listwidget = event.source.parent.getWidget("my_list");
        
		listwidget.setSelectionList(viewData.myList,"key","value");
	 	...

It worked well with version 2.1.4

But with version 2.1.5 I'm getting this error

	viewData" is not defined.
	org.apache.avalon.framework.CascadingRuntimeException: "viewData" is not defined.

How do I have to change my functions? Upgrade to Form.js (v2) ?

Thanks!

Jörn

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Mime
View raw message