1

I'm using uniform.js in my GWT app. I need to change the values of the select item diagrammatically. But, the widget seems does not get updated. I know this can be updated using

$.uniform.update();

But, how can I do it in GWT?

appbootup
  • 9,537
  • 3
  • 33
  • 65
Sree
  • 921
  • 2
  • 12
  • 31
  • What have you tried? Did you read and attempt any solution using https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsJSNI – appbootup Mar 12 '13 at 03:17
  • Uniform.js is based out of Jquery. GWT has a port of jquery called GwtQuery. Give that a try. – appbootup Mar 12 '13 at 03:33

2 Answers2

1

Hi I has the similar issue. I tried the below JSNI. It worked for me.

 $wnd.jQuery(".checker span").each(function(){
 if(!$wnd.jQuery(this).parent().find("input:checkbox").is(':checked'))
 {
 $wnd.jQuery(this).removeClass("checked"); 
 }
 });

 $wnd.jQuery(".selector span").each(function(){
 $wnd.jQuery(this).html($wnd.jQuery(this).parent().find(":selected").text());
 });
0

Yeh .You can contact with jquery from gwt by using JSNI .

Try using this

public static native void update() /*-{
  $wnd$.uniform.update();
}-*/; 

or like

public static native void update() /*-{
     $wnd.jQuery.uniform.update();
    }-*/; 

And call the static method update() in your GWT class

Suresh Atta
  • 120,458
  • 37
  • 198
  • 307
  • Have a look on this also http://stackoverflow.com/questions/7366123/calling-jquery-function-from-gwt – Suresh Atta Mar 12 '13 at 06:43
  • I tried $wnd.jQuery.uniform.update(); and $wnd.jQuery.uniform.update("#id"); I didnt get any error, but my widget doesnt get updated – Sree Mar 12 '13 at 17:05