I'm not experienced with javascript at all so bear with me. I'm trying to
make a Web Interface with many buttons, check boxes, selection lists, etc.
and associate with these widgets a set of data.  So that changing the
selections on the interface update the data set.

Using qooxdoo, I made a class to hold the data, and added member functions
that will update the data set, based on passed variables.  I then created an
interface window with all the widgets. What I want to do is associate the
member functions of the data set with listeners of the corresponding
widgets.  My simple brain would like to do the following:

In window interface class:
* ...
    mycheckboxgroup.addListener("changeSelection",
myDataSet.updateFunction(data_name,mycheckboxgroup), myDataSet);
 ...*

Then in data set class:
* ...
    updateFunction : function(data_name,checkbox)
    {
        value = checkbox.getSelected().getValue();
        this.setData(data_name,value);
     }
 ...*

This implimentation just executes the updateFunction once as the listener is
added.  Based on what I've read, this is because the function argument
should be a pointer to a function rather than a function() call.  But then
how do you pass arguments to the Listener as it is constructed?

Is there a way to create a generic listener function that takes variable
arguments?  I don't want to have to write the code for each new listener
function for each of the 50 checkboxgroups i have, but I want to add a
listner to each and associate that listener to a data set based on a
variable.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to