haxeui / haxeui-heaps

MIT License
31 stars 12 forks source link

TableView - Can't cast haxe.ui.components.Label to haxe.ui.core.ItemRenderer #30

Closed hoseyjoe closed 2 years ago

hoseyjoe commented 3 years ago

There are 2 places in tableview that use findComponent.

  1. line 436
    var existing = _tableview.itemRenderer.findComponent(column.id, ItemRenderer, true);
  2. line460 var existing = item.findComponent(column.id, ItemRenderer, true);

Changing ItemRenderer to Component fixes the issue. Not sure if it is the best fix?

Can't cast haxe.ui.components.Label to haxe.ui.core.ItemRenderer

Called from haxe.ui.containers._TableView.Builder.fillExistingRenderer (haxe/ui/containers/TableView.hx line 446)
Called from haxe.ui.containers._TableView.Builder.onReady (haxe/ui/containers/TableView.hx line 343)
Called from haxe.ui.core.Component.~ready.2 (haxe/ui/core/Component.hx line 1301)
Called from haxe.ui.util.$Timer.~delay.1 (haxe/ui/util/Timer.hx line 10)
Called from haxe.ui.backend.$TimerImpl.update (haxe/ui/backend/TimerImpl.hx line 13)
Called from haxe.ui.backend.$BackendImpl.update (haxe/ui/backend/BackendImpl.hx line 7)
Called from haxe.ui.backend.AppImpl.onHeapsUpdate (haxe/ui/backend/AppImpl.hx line 47)
Called from haxe.ui.backend._AppImpl.HeapsApp.update (haxe/ui/backend/AppImpl.hx line 18)
Called from hxd.App.mainLoop (hxd/App.hx line 187)
Called from hxd.App.~setup.2 (hxd/App.hx line 144)
Called from hxd.App.loadAssets (hxd/App.hx line 170)
Called from hxd.App.setup (hxd/App.hx line 140)
Called from h3d.Engine.onCreate (h3d/Engine.hx line 256)
Called from h3d.impl.DirectXDriver.~init.1 (h3d/impl/DirectXDriver.hx line 262)
Called from haxe.$Timer.~delay.0 (C:\SDKs\Haxe\haxe\std/haxe/Timer.hx line 144)
Called from haxe.$Timer.~__constructor__.0 (C:\SDKs\Haxe\haxe\std/haxe/Timer.hx line 76)
Called from sys.thread.EventLoop.progress (C:\SDKs\Haxe\haxe\std/sys/thread/EventLoop.hx line 114)
Called from hxd.$System.runMainLoop (hxd/System.hl.hx line 152)
Called from hxd.$System.runMainLoop (hxd/System.hl.hx line 142)
Called from haxe.$Timer.~delay.0 (C:\SDKs\Haxe\haxe\std/haxe/Timer.hx line 144)
Called from haxe.$Timer.~__constructor__.0 (C:\SDKs\Haxe\haxe\std/haxe/Timer.hx line 76)
Called from sys.thread.EventLoop.loop (C:\SDKs\Haxe\haxe\std/sys/thread/EventLoop.hx line 150)
Called from sys.thread._Thread.$Thread_Impl_.processEvents (C:\SDKs\Haxe\haxe\std/hl/_std/sys/thread/Thread.hx line 62)

Simplified.zip

hoseyjoe commented 2 years ago

Simplified.zip