Friday, May 13, 2016

jsinterop: modeling inheritance problem

Hi,

I am trying to model with jsinterop libraries that build upon jquery such as bootstrap and DataTables.net. As such I would like to extend the basic jquery return type with a child class.

For example

where JQuerySelection is
@JsType(isNative = true)
public class BaseClass {}

@JsType(isNative = true)
public class ChildClass extends BaseClass{}

The upcasting from BaseClass to ChildClass does not work.

If I use interfaces instead of class definition it works and I can cast but I am loosing the capability to have non static @jsoverlay methods

Is this a bug? Is this on purpose? Is there any workaround? What is the best practice in such cases?

I originally asked this question here.
https://mail.google.com/mail/u/0/#sent/15451bb5028c8343
Hopefully now makes more sense.


--
Vassilis Virvilis

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment