#2467 Cannot call TabPane.tabs() in Javascript

SlimerDude Mon 21 Sep 2015

Hi Andy, first of all, thanks for looking at and merging the other patches.

Whilst you're in the flow, I thought I'd re-iterate this little issue - when you call TabPane.tabs() in Javascript you get:

sys::CastErr: fwt::Widget[] cannot be cast to fwt::Tab[]

I mentioned it in `http://fantom.org/forum/topic/2453#c3` because I suspect it's part of a larger type cast problem. But as a workaround until that gets addressed, it'd be cool if you could look at incorporating this patch (if appropriate):

diff -r a77e9070251b src/fwt/fan/TabPane.fan
--- a/src/fwt/fan/TabPane.fan	Fri Sep 04 09:11:51 2015 -0400
+++ b/src/fwt/fan/TabPane.fan	Wed Sep 09 23:34:30 2015 +0100
@@ -33,7 +33,7 @@
   ** Get the list of installed tabs.  Tabs are added and
   ** removed using normal `Widget.add` and `Widget.remove`.
-  Tab[] tabs() { return Tab[,].addAll(children) }
+  Tab[] tabs() { children.map |kid->Tab| { kid } }
   ** The currently selected index of `tabs`.

andy Tue 22 Sep 2015

Login or Signup to reply.