ok, I was debugging Nifty.
I found that the problem is the vertical scroll event is not being listened, because the listeners list is empty.
BrokenStack1 The subscribers (listeners) list related to this exact match subscription topic âconsole#listBox#scrollpanel#vertical-scrollbarâ returns empty.
ThreadSafeEventService.publish(String, Object) line: 920
Nifty.publishEvent(String, NiftyEvent) line: 306
ScrollbarControl$ScrollbarViewVertical.valueChanged(float) line: 267
ScrollbarImpl.changeValue(float) line: 175
ScrollbarImpl.interactionMove(int) line: 156
ScrollbarControl.mouseMove(int, int) line: 125
OkStack2 The first time the console is opened, this is a working v.scroll stack trace:
ListBoxImpl<T>.updateView() line: 69
ListBoxImpl<T>.updateView(int) line: 64
ListBoxControl$1.onEvent(String, ScrollbarChangedEvent) line: 81
ListBoxControl$1.onEvent(String, Object) line: 78
Nifty$ClassSaveEventTopicSubscriber.onEvent(String, Object) line: 1750
ThreadSafeEventService.publish(Object, String, Object, List, List, StackTraceElement[]) line: 980
ThreadSafeEventService.publish(String, Object) line: 920
Nifty.publishEvent(String, NiftyEvent) line: 306
ScrollbarControl$ScrollbarViewVertical.valueChanged(float) line: 267
ScrollbarImpl.changeValue(float) line: 175
ScrollbarImpl.interactionMove(int) line: 156
ScrollbarControl.mouseMove(int, int) line: 125
As you can see, after the publish, the subscriber is found and it runs properly at OkStack2.
What I am not understanding at BrokenStack1 is:
-
the vert scroll is unsubscribed initially
Nifty.unsubscribe(String, Object) line: 332
ListBoxControl.removeVerticalScrollbar() line: 443
ListBoxControl.initializeScrollPanel() line: 824
ListBoxControl.init(Parameters) line: 291
-
but just after it is re-subscribed
ListBoxControl.subscribeVerticalScrollbar(Element) line: 353
ListBoxControl.createVerticalScrollbar() line: 409
ListBoxControl.updateTotalCount(int) line: 533
ListBoxImpl.updateViewTotalCount() line: 407
ListBoxControl.init(Parameters) line: 300
-
how can the BrokenStack1 return an empty list at here?
ThreadSafeEventService.getSubscribers(Object, Map) line: 1387
ThreadSafeEventService.getSubscribersToTopic(String) line: 1239
ThreadSafeEventService.getSubscribers(String) line: 1221
ThreadSafeEventService.publish(String, Object) line: 920
Nifty.publishEvent(String, NiftyEvent) line: 306
ScrollbarControl$ScrollbarViewVertical.valueChanged(float) line: 267
ScrollbarImpl.changeValue(float) line: 175
ScrollbarImpl.interactionMove(int) line: 156
ScrollbarControl.mouseMove(int, int) line: 125
-
This code is working and the result is an empty list:
ThreadSafeEventService.getSubscribers(Object, Map) line: 1387
subscriberMap.get(classOrTopic);
-
after the console is opened, onEndScreen() is happening, that unsubscribes the v.scroll listener:
ThreadSafeEventService.unsubscribe(String, EventTopicSubscriber) line: 690
Nifty$SubscriberRegistry.unsubscribeElement(Screen, String) line: 1937
Nifty.unsubscribeElement(Screen, String) line: 348
Element.onEndScreen(Screen) line: 2620
ElementRemoveAction.perform() line: 33
EndOfFrameElementAction.perform() line: 22
Nifty.executeEndOfFrameElementActionsInternal() line: 485
Nifty.handleDynamicElements() line: 437
Nifty.update() line: 368
InputSystemJme.endInput() line: 112
InputManager.processQueue() line: 843
InputManager.update(float) line: 907
PS.: I got the sources for eventbus-1.4.jar here, to help on debugging.