Hi David,

One way to do what you want is as follows:

1. Your form subclass should add an event listener to its delete button in some initialise method that is called on creationComplete.

2. The handler for that button press event should dispatch ANOTHER event. This event is of a custom type that you define and describes the meaning of what occurred. For instance DeleteScheduleRequestEvent. This event should encapsulate enough data for your controller (which may be the parent document), to know the appropriate response for the event. This data will no doubt include the schedule object which is to be deleted.

3. Your parent document should add an event listener to the form instance to catch these deletion request events. It can then respond appropriately. The controller doesn't need to know which button was involved, only the meaning of what the user is trying to do by pressing the button. This is the reason for your custom event type.

If your forms are also nested inside a repeater it should also work to add the event listener to the repeater to catch events that occur on its children.

Cheers,
Lach


On 06/12/2006, at 2:56 PM, pedalspeed1 wrote:

Two Parts:

I have a sub-classed form that has multiple components. The
sub-classed form is a scheduling widget and the user can
create/update/delete multiple schedules.

The form has a delete button. When the user clicks the delete button,
I need the parent document to listen for this specific button's press,
and then to remove the particular subclass.

My confusion is: How do I get a parent document, to listen to a
specific instance, within a subclass, within a repeater?

Best.
D.Buhler

Reply via email to