@JsNamespace("$wnd.jdramaix")Isn't it a better way to do that ?
public class AgeSliderImpl
@JsNamespace("$wnd.jdramaix")
public class AgeSliderImpl implements AgeSlider {
public int age;
@Override
public int getAge() {
return age;
} }
@JsType
public interface AgeSlider {
@JsProperty
int getAge();}
Dear GWT lovers,I've finally started to play with JsInterop in GWT 2.7 and mainly I'm trying to use JsInterop in order to write polymer components.So far, I have two questions:1. I'm using super dev mode and so I'm obliged to use the CrossSiteIframeLinker. As the javascript code generated by GWT is loaded in an iframe, the exported types are not accessible from the main window (only from the iframe). The workaround I found to expose java type from the main window is to prefix my namespace by $wnd@JsNamespace("$wnd.jdramaix")Isn't it a better way to do that ?
public class AgeSliderImpl
2. I want to expose some java field of my class to javascript field. I'm trying to use @JsProperty for this purpose but it seems not to work:@JsNamespace("$wnd.jdramaix")
public class AgeSliderImpl implements AgeSlider {
public int age;
@Override
public int getAge() {
return age;
} }@JsType
public interface AgeSlider {
@JsProperty
int getAge();}
If I try to access the field in the javascript console,it is undefined:Same problem if I rename the method to age(). slider.age is defined by point to a function.> var slider = new jdramaix.AgeSliderImpl()> slider.age< undefinedBut the method getAge exists:> slider.getAge< function getAge_0_g$(){< return this.age_3_g$;< }Does @JsProperty work (at least when we export Java to Javascript) in GWT 2.7. ? If so how to use it ?
@JsType
public class AgeSlider {
public int age; }
--ThanksJulien
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/CABb_3%3D6WZanScYy1ZqHBR23yssh9uvDLWe%3DquGaiixcpOusBog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
@JsNamespace("jdramaix")
@JsType
public class AgeSlider {
public int age;
@JsExportWith sdm, in javascript, I'm not able to do: var slider = new jdramaix.AgeSlider();
public AgeSlider() {
} // other public methods are exported }
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAN%3DyUA2CSorYH4oHFzGsVrRD1cfnDM1n_jEOJ4upOYyeukm4eQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/CABb_3%3D6B1p%2BuAwuPjNW78dQCXJ0xuTQC2DJte1%2BfE2z58fm-vQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAN%3DyUA2ity35giPe3UMq-axcWU3fj6BbKk7JFX74R0uRs8LCVw%40mail.gmail.com.
ThanksJulien
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/CABb_3%3D6WZanScYy1ZqHBR23yssh9uvDLWe%3DquGaiixcpOusBog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAN%3DyUA2CSorYH4oHFzGsVrRD1cfnDM1n_jEOJ4upOYyeukm4eQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/CABb_3%3D6B1p%2BuAwuPjNW78dQCXJ0xuTQC2DJte1%2BfE2z58fm-vQ%40mail.gmail.com.--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/CABb_3%3D5Vc8ie%3D0FLghOP4TpvK83rBh4ZFZ2D80A07Nd%3Du4Bf6w%40mail.gmail.com.To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-co...@googlegroups.com.