2010-11-02 7 views
0
<script type="text/javascript"> 
var a = 0; 
</script> 

Maintenant, j'ai GWT:champ d'instance natif JS global

public class AA implements EntryPoint { 

    public final int a =44; 

} 

Comment puis-je transférer le champ d'instance a vers une variable JavaScript globale native pour qu'il puisse être appelé à partir d'une méthode javascript?

+0

http://www.emgarten.com/using-jsni-in-gwt.htm –

Répondre

2
public native void init (Integer arg)/*-{ 
    $wnd.a = arg; 
}-*/;