Mark Hagerman
18 Jun 2012, 9:46 AM
I'm developing code that creates a form.panel inside a panel. The form panel contains a checkbox; if the user clicks the checkbox, the application responds by creating a new instance of the form panel and adding it into the container. At present, my event listener for the checkbox' change event resides in the container; it seems to me I should move that functionality into a controller.
The question is this: Can I use the controller's control() method to establish the listener(s) for the checkbox? I would expect not, since the checkboxes (other than the first one, perhaps) won't exist at the time the control() method is run. Should I continue to dynamically add the change listener to each checkbox as it's created, or is there a better way?
The question is this: Can I use the controller's control() method to establish the listener(s) for the checkbox? I would expect not, since the checkboxes (other than the first one, perhaps) won't exist at the time the control() method is run. Should I continue to dynamically add the change listener to each checkbox as it's created, or is there a better way?