I’ve run into a problem that I have no idea what the solution could be.
I have two “pages” in the application, WeeklyWidget and Monthly widget. Both extend ContentWidget.
I initialize them as
weekly_widget = new WeeklyWidget();
monthly_widget = new MonthlyWidget();
content_panel.setWidget(home_widget);
and then using History tokens, I change the content_panel
public void onHistoryChanged(String historyToken) {
if (historyToken.equals("monthlyReports")) {
content_wrapper.setWidget(monthly_widget);
} else if (historyToken.equals("weeklyReports")) {
content_wrapper.setWidget(weekly_widget);
} else if (historyToken.equals("home")) {
content_wrapper.setWidget(home_widget);
}
}
Everything APPEARS ok, and the content panel does change to reflect the appropriate widget. However, depending on which widget is initialized first (first code sample above initializes weekly before monthly), then a button in that widget does not work. In this case, a button on weekly widget does not work. The error is
17:32:18.390:TMR0:DEBUG:EventHandler:mousing over [Button ID:isc_OID_14]
17:32:18.953:MDN8:INFO:EventHandler:Target Canvas for event 'mousedown': [Button ID:isc_OID_14]
17:32:18.953:MDN8:DEBUG:EventHandler:Bubbling event 'prepareForDragging', target '[Button ID:isc_OID_14]' has handler: Canvas.prepareForDragging()
17:32:18.953:MDN8:DEBUG:EventHandler:Event 'prepareForDragging' bubbled to top
17:32:18.953:MDN8:DEBUG:EventHandler:No dragTarget, not dragging
17:32:18.953:MDN8:DEBUG:EventHandler:Event 'mouseDown' bubbled to top
17:32:18.953:MDN8:DEBUG:EventHandler:Event 'mouseStillDown' bubbled to top
17:32:19.031:MUP3:INFO:EventHandler:Target Canvas for event 'mouseup': [Button ID:isc_OID_14]
17:32:19.046:MUP3:WARN:Log:Error:
'Object required'
in http://localhost:8888/com.gnets.GnetsProject/GnetsProject.html
at line 1610
Element.getOffsetLeft(_1=>[DIVElement]{ID:isc_O})
Element.$yw(_1=>"left", _2=>[DIVElement]{ID:isc_O}, _3=>[BODYElement]{nodeName:BODY}, _4=>false)
Element.$s4(_1=>[DIVElement]{ID:isc_O}, _2=>[BODYElement]{nodeName:BODY}, _3=>false)
"return this.$yw(isc.Canvas.LEFT,_1,_2,_3)"
Canvas.$s4(_1=>undef)
Canvas.getPageLeft()
Canvas.containsPoint(_1=>490, _2=>181, _3=>false)
Canvas.visibleAtPoint(_1=>490, _2=>181, _3=>undef, _4=>undef)
EventHandler.$k5(_1=>Obj{type:error}, _2=>undef)
EventHandler.handleMouseUp(_1=>Obj{type:error}, _2=>undef)
EventHandler.dispatch(_1=>EventHandler.handleMouseUp(), _2=>Obj{type:error})
anonymous(event=>undef)
"var returnVal=arguments.callee.$ch.isc.EH.dispatch(arguments.callee.$j2,event);return returnVal;"
It seems as if the second (weekly widget or monthly widget) to be initialized is overwriting something somehow. If I reverse the initialization order, then the working / non-working buttons switch.
Does anyone know what the problem might be or how I can detect it? Code in next posting.