Menu

#20 Control not handled when using Hierarchy of controllers

open
nobody
Core/Basic (9)
5
2003-01-12
2003-01-12
Anonymous
No

Im having some trouble with the example giving me a warning,
"[java]  WARN [AWT-EventQueue-0] (?:?) - Control not handled:
Control(Selected,null)"

In my childcontroller I have code to handle events of
Selected-type but
somehow it slips past and the parent controller doesent know how
to handle
it either. I think I have found out that the event fires when the
model
changes its selection at creation in the model-contructor and
should be
caught by the bound view. In the code in the example the view is
set after
the model has been created and so the link between them is not
working and
the event is lost. Is this right? When I switch order and bind the
view
before the model everything is working properly.

Sourcecode from Hierarchy of controllers on page
http://scope.sourceforge.net/guide/controller.html#specific

public class ParentController extends BasicController {
public ParentController() {
ParentView view = new ParentView();
setModel(new ParentModel());
setView(view);
ChildController childController = new
ChildController(view.getChildView());
this.addChild(childController);
}
}
public class ChildController extends BasicController {
public ChildController(ChildView view) {
setModel(new ChildModel());
setView(view);
}
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.