Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • nova3421
    started a topic DateRangeDialog

    DateRangeDialog

    I'm having a little trouble understanding how to correctly use this class, could someone give me a quick example?

    Details:
    I tried the below but all it showed was a window with nothing in it. Also I can't find a example on the showcase with this class.

    Code:
    ...
    DateRangeItem dRItem = new DateRangeItem();
    dRItem.setFromTitle("From");
    dRItem.setToTitle("To");
    DateRangeDialog dRDialog = new DateRangeDialog();
    dRDialog.setHeaderTitle("Date Range Dialog");
    dRDialog.setOkButtonTitle("OK");
    dRDialog.setWidth(200);
    dRDialog.setHeight(200);
    DateRangeDialog.askForRange(true, dRItem, dRDialog, "testIt");
    ...
    public void testIt(){
         System.out.println("HI");
    }
    SmartGWT: v9.0p_2013-09-19/EVAL Deployment
    GWT: 2.5.1

  • Isomorphic
    replied
    Originally posted by nova3421 View Post
    I'm having a little trouble understanding how to correctly use this class, could someone give me a quick example?
    For SmartGWT 12.0+, we've added a new signature for askForRange() that takes a real callback defined as a Java class, DateRangeCallback.

    This will be in the nightly builds dated 2019-05-08 and beyond.

    Leave a comment:


  • webghost_39
    replied
    you need to expose your method by JSNI.

    here is a example.
    package mypackage; public MyUtilityClass { public static int computeLoanInterest(int amt, float interestRate, int term) { ... } public static native void exportStaticMethod() /*-{ $wnd.computeLoanInterest = $entry(@mypackage.MyUtilityClass::computeLoanInterest(IFI)); }-*/; }

    and here is the url for JSNI http://www.gwtproject.org/doc/latest...asicsJSNI.html

    a quick way to test the return value is
    DateRangeDialog.askForRange(true, dRItem, dRDialog, "console.log(value)");

    Leave a comment:

Working...
X