[Zope3-Users] z3c.formjs - global js-variables and form-content in scripts

garz garz at gmx.net
Wed Sep 17 19:48:53 EDT 2008


i'm working with z3c.formjs and there are three questions that arose.

1.) defining global variables
i'd like to define some global variables that i can refer to in the
functions that i want to define with the jsfunction-package. for example a
global counter that counts something. is there any possibility to do so?

2.) form-content in jsfunctions-scripts
i want to define a jsfunction that returns a rendered widget. this widget is
an information that the particular instance of a form has. so i need to
somehow access that form to get that widget. as far as i can see this there
is no possibility to do this with jfsunction-package, since the functions
defined with it are static and they arent given any useful parameter-values
when called.

so i looked at jsevent and jsaction but the problem there is they dont know
the source form neither. they know the calling request, but since im working
with subforms, i need to know the exact form where the executed handler is
coming from. neither the request nor the jssubscriptions know about the

so it isnt meant to weave form-specific data into the js-script. so what is
the solution to this? i cant see it.

3.) jssubscriptions-renderer
why are those renderers only in the testing-package? arent they good enough?
or is this usually done another way?


my goal is to write a general sequence-form, that can display a sequence
consisting of an arbitrary widget. it should provide delete-buttons for
every element. in add-forms, the functionality of these should be realized
through javascript, dom-manipulation plus submit and in edit-forms without
submit but with ajax.

since i dont think that that there is a solution to this need, i think i
will have to adjust formjs. i would like to make that clean, means i dont
want to do a "hacky" formjs-adaption. maybe this usecase is already known
and there is interest in evolving formjs? maybe through new packages? maybe
through rewrites?

otherwise i'm just doing my own thing on formjs.
View this message in context: http://www.nabble.com/z3c.formjs---global-js-variables-and-form-content-in-scripts-tp19543467p19543467.html
Sent from the Zope3 - users mailing list archive at Nabble.com.

More information about the Zope3-users mailing list