Giter Club home page Giter Club logo

Comments (8)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 2, 2024
Try this:

DateRangeFilter filter = new DateRangeFilter();
filter.addStateChangeHandler(new StateChangeHandler()
{
    @Override
    public void onStateChange(StateChangeEvent event)
    {
        GWT.log("onStateChange >" + ((DateRangeFilterState)filter.getState()).getHighValue());
    }
}

Also check the showcase example on DateRangeFilter: 
http://gwt-charts.appspot.com/#daterangefilter

Please give me feedback.
Thank you!

Original comment by [email protected] on 3 Mar 2015 at 7:21

  • Changed state: Accepted
  • Added labels: Type-Other
  • Removed labels: Type-Defect

from gwt-charts.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 2, 2024
In fact, I have based my work on the daterangefilter on your showcase ;-)

I didn't get any problem (the filtering on the chart side is happening very 
well) excepted I can't get now the selected values from the DateRangeFilter.

I have tried also the casting option you are proposing above. It does not work 
neither.
FYI, it also blocks the filtering in the sense that the bound chart does not 
change neither.

Original comment by [email protected] on 3 Mar 2015 at 7:38

from gwt-charts.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 2, 2024
I've tested this exact code on the showcase and it worked perfectly.
I can see the output on the browser console.

Just to check, in your snippet you have two different filters: 'filter' and 
'processFlawDRFilter'. Is that a typo?

Original comment by [email protected] on 3 Mar 2015 at 7:44

from gwt-charts.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 2, 2024
In fact this is not a typo in my code, I have badly paste it :
        processFlawDRFilter = new DateRangeFilter();
        processFlawDRFilter.addStateChangeHandler(new StateChangeHandler()
        {
            @Override
            public void onStateChange(StateChangeEvent event)
            {
                GWT.log("onStateChange >" + ((DateRangeFilterState)processFlawDRFilter.getState()).getHighValue());


I'm going to copy/paste your showcase code and try a bisect.

I will do that on tomorrow (it is a bit late for me now).
I will keep you informed. Thank a lot for your help and reactivity !

Original comment by [email protected] on 3 Mar 2015 at 8:00

from gwt-charts.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 2, 2024
Hi Rui

I have copied and pasted the code from 
"http://gwt-charts.appspot.com/#daterangefilter", as it is.
I have modified the method getDateRangeFilter as : 
private DateRangeFilter getDateRangeFilter() {
        if (dateRangeFilter == null) {
            dateRangeFilter = new DateRangeFilter();
            dateRangeFilter.addStateChangeHandler(new StateChangeHandler()
            {
                @Override
                public void onStateChange(StateChangeEvent event)
                {
                    GWT.log("onStateChange >" + ((DateRangeFilterState)dateRangeFilter.getState()).getHighValue());
                }
            });
        }
        return dateRangeFilter;
    }

I have made a trial with :
- GWT.log("onStateChange >" + 
dateRangeFilter.getObject().getState().getHighValue());
  -> it does not work
- GWT.log("onStateChange >" + dateRangeFilter.getObject().getState());
  -> it works (output = "[INFO] [flower] - onStateChange >[object Object]")
- GWT.log("onStateChange >" + dateRangeFilter.getObject().getContainerId());
  -> it works (output = [INFO] [flower] - onStateChange >gwt-uid-4");

I'm in Dev Mode and run the app on IE 10 (v 10.0.23).

Tell me if I can do more test for helping you to investigate.

thank a lot for your help

JM

Original comment by [email protected] on 4 Mar 2015 at 8:17

from gwt-charts.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 2, 2024
and obviously the call to GWT.log("onStateChange >" + 
((DateRangeFilterState)dateRangeFilter.getState()).getHighValue());
does not work.

Original comment by [email protected] on 4 Mar 2015 at 8:18

from gwt-charts.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 2, 2024
I have made an other modification to your code by adding a button :
Button b = new Button();
b.setText("test");
b.addClickHandler(new ClickHandler()
{
    @Override
    public void onClick(ClickEvent arg0)
    {
    GWT.log("onStateChange >" + ((DateRangeFilterState)dateRangeFilter.getState()).getHighValue());
    }
});
panel.addSouth(b, 30);

An error message is generated as soon as the button is used :

com.google.gwt.event.shared.UmbrellaException: Exception caught: Something 
other than a double was returned from JSNI method 
'@com.googlecode.gwt.charts.client.controls.filter.DateRangeFilterState::getHigh
Value()': JS value of type JavaScript object(799), expected double
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
...

Caused by: com.google.gwt.dev.shell.HostedModeException: Something other than a 
double was returned from JSNI method 
'@com.googlecode.gwt.charts.client.controls.filter.DateRangeFilterState::getHigh
Value()': JS value of type JavaScript object(799), expected double
    at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:112)
...

Original comment by [email protected] on 4 Mar 2015 at 11:08

from gwt-charts.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 2, 2024
I use GWT 2.6.1 and Java 7

Original comment by [email protected] on 4 Mar 2015 at 11:14

from gwt-charts.

Related Issues (20)

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.