GithubHelp home page GithubHelp logo

Comments (12)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 23, 2024
Too bad jQuery UI isn't following any kind of standardized patterns.

I've included another method to run widget methods as a workaround.
  public JavaScriptObject method(String method) {
    return invoke(ui, widgetType, method);
  }

Just below the option() method inside UiWidget.java.

So to run a method, you'd have to use:
$("#dialogForm").as(Ui).dialog().method("open");

-

Let's hope the jQueryUI team will do a better job on the upcoming API rewrite.

Original comment by [email protected] on 15 Aug 2011 at 5:39

from gwtquery-ui.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 23, 2024
Try the "Animated Dialog" demo here: 
http://gwtquery-ui.googlecode.com/svn/demos/GwtQueryUi.html

Does the dialog open when you click the button? It does in Chromium 13.

Also, the Dialog class already has an "open" method. You should be able to do 
this:

$("#dialogForm").as(Ui).dialog().open();

Original comment by [email protected] on 15 Aug 2011 at 7:47

from gwtquery-ui.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 23, 2024
Ah, haven't expected real methods there, sorry.
Though it would look more like jQuery.

Nevertheless, like I said jQuery is following kind of chaotic patterns.
For example:
.dialog( "isOpen" )
Returns true if the dialog is currently open.

So this method returns a value.
Can't find it in qwtquery-ui.

I guess we'd need something like: invokeForInt, invokeForBoolean, 
invokeForClass... so it's easier to implement inside DialogPlugin for instance.

What do you think?

Original comment by [email protected] on 15 Aug 2011 at 8:20

from gwtquery-ui.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 23, 2024
Well, gwtquery-ui tries to re-implement the functionalities available in 
jQueryUI, but it can't be identical because of the nature of JavaScript.

I made gwtquery-ui more Java-esque (have typesafe methods for example) on 
purpose. The goal is not to have a one to one relationship with jQueryUI's API.

That being said, it would be useful to have gwtquery-ui be more "open ended" 
and allow calling any method on the jQuery instance.

Original comment by [email protected] on 15 Aug 2011 at 8:52

from gwtquery-ui.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 23, 2024
yes, I know.
But it would be much easier to have some prepared invoke methods to be able to 
use them inside upper widget objects, like the ones you're already using 
(invoke).

I'd like to implement the missing isOpen for instance.
There are plenty other methods that would make use of it.

Like your current implementation inside Datepicker:
  public Date getDate() {
    invoke("getDate");
    return null;
  }

seems like there is something missing ;)

Original comment by [email protected] on 15 Aug 2011 at 9:14

from gwtquery-ui.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 23, 2024
Oops! :)

Patches welcomed! I'll gladly review patches you submit and merge them when 
appropriate.

Original comment by [email protected] on 15 Aug 2011 at 9:44

from gwtquery-ui.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 23, 2024
ok, I've done some changes and fixes.

Check the diffs file.

Original comment by [email protected] on 15 Aug 2011 at 11:50

Attachments:

from gwtquery-ui.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 23, 2024
Thanks for the patch. Mind rewriting the invokeFor* methods to only take the 
method argument?

protected int invokeForInt(String method) {
  return invokeForInt(ui, widgetType, method);
}

I'd like to hide the implementation (passing the jQuery instance and using 
widgetType) within UiWidget.

Original comment by [email protected] on 16 Aug 2011 at 12:10

  • Changed state: Accepted

from gwtquery-ui.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 23, 2024
No, it's ok.
You'd have to add more methods with more arguments then.
I've moved some of your invoke implementations to UiWidget.

See Slider:
  public Slider values(int index, JsArrayNumber values) {
    ui = invoke(ui, widgetType, "values", index, values);
    return this;
  }

That's why I changed them to protected.

Original comment by [email protected] on 16 Aug 2011 at 12:24

from gwtquery-ui.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 23, 2024
Added isOpen method in r143. Fixed getDate in Datepicker also.

Original comment by [email protected] on 16 Aug 2011 at 12:08

  • Changed state: Fixed

from gwtquery-ui.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 23, 2024
Do you think you could take all changes into count?

For example the Slider.java:
  public Slider value(Number value) {
    invoke("value", value);
    return this;
  }

  public int intValue() {
    return invokeForInt(ui, widgetType, "value");
  }

  public int intValues(int index) {
    return invoke(ui, widgetType, "values", index);
  }

  public Slider values(int index, JsArrayNumber values) {
    invoke(ui, widgetType, "values", index, values);
    return this;
  }

  private native final int invoke(JavaScriptObject ui, String type, String method, int index)
  /*-{
    return ui[type](method, index);
  }-*/;

  private native final JavaScriptObject invoke(JavaScriptObject ui, String type, String method, int index, Object args)
  /*-{
    return ui[type](method, index, args);
  }-*/;


Datepicker.java is still missing:
  public boolean isDisabled() {
    return invokeForBoolean(ui, widgetType, "isDisabled");
  }

take a look at the ones I've attached earlier.
Thanks

Original comment by [email protected] on 16 Aug 2011 at 1:04

from gwtquery-ui.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 23, 2024
Done.

Original comment by [email protected] on 16 Aug 2011 at 1:44

from gwtquery-ui.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.