Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

value spinner when added to a panel throws exception #387

Open
GoogleCodeExporter opened this issue Feb 16, 2016 · 7 comments
Open

value spinner when added to a panel throws exception #387

GoogleCodeExporter opened this issue Feb 16, 2016 · 7 comments

Comments

@GoogleCodeExporter
Copy link

What version of gwt and gwt-incubator are you using?
Gwt version 2.3 + latest incubator jar 
What OS and browser are you using?
Windows Vista and firefox, chrome
Do you see this error in hosted mode, web mode, or both?
 hosted mode
(If possible, please include a test case that shows the problem)

Hopefully using the test case you have generously provided, what steps will 
reproduce the problem?

i inherited the two gwt xml files
<inherits name='com.google.gwt.widgetideas.WidgetIdeas' />   
   <inherits name='com.google.gwt.libideas.LibIdeas' />


1.Simply create a instance of ValueSpinner()
2. Add it to rootPanel
3. run the app

ValueSpinner spinner = new ValueSpinner(10);
RootPanel.get().add(spinner);

What is the expected output? What do you see instead?
I expected a spinner will be displayed on the UI, but seen an error 

Caused by: java.lang.RuntimeException: Deferred binding failed for 
'com.google.gwt.widgetideas.client.ValueSpinner$ValueSpinnerResources' (did you 
forget to inherit a required module?) at 
com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53) at 
com.google.gwt.core.client.GWT.create(GWT.java:98) at 
com.google.gwt.widgetideas.client.ValueSpinner.(ValueSpinner.java:191) at 
com.google.gwt.widgetideas.client.ValueSpinner.(ValueSpinner.java:157) at 
com.google.gwt.widgetideas.client.ValueSpinner.(ValueSpinner.java:142) at 
com.google.gwt.widgetideas.client.ValueSpinner.(ValueSpinner.java:98) at 
com.example.myproject.client.Sample.onModuleLoad(Sample.java:13)


Workaround if you have one:

Please provide any additional information below,  and thank you for taking the 
time and effort to report this issue, as good issue reports are critical for 
our quest to make GWT's new widgets and libraries shine.

Original issue reported on code.google.com by [email protected] on 11 Aug 2011 at 4:24

@GoogleCodeExporter
Copy link
Author

Add following to your module file (.gwt.xml)

    <inherits name='com.google.gwt.widgetideas.WidgetIdeas' /> 
    <inherits name='com.google.gwt.libideas.LibIdeas' />

Original comment by [email protected] on 24 Dec 2011 at 2:03

@GoogleCodeExporter
Copy link
Author

I think it's not resolved, with the workaround too (under GWT-2.4.0), as the 
"client/" source path is not defined from thoses modules. The ValueSpinner 
class cannot be found.

Original comment by [email protected] on 6 Mar 2012 at 5:25

@GoogleCodeExporter
Copy link
Author

I just found a workaround. Issue does not happen when ValueSpinner is 
instantiated via the following constructor:

public ValueSpinner(long value, int min, int max, int minStep, int maxStep,
      boolean constrained, ValueSpinnerResources resources)

In order to invoke the above constructor, I implemented the following dummy 
ValueSpinnerResources:

class DummyValueSpinnerResources implements
        ValueSpinner.ValueSpinnerResources {

    @Override
    public ResourcePrototype getResource(String name) {
        return null;
    }

    @Override
    public ResourcePrototype[] getResources() {
        // TODO Auto-generated method stub
        return new ResourcePrototype[] {};
    }

    @Override
    public DataResource background() {
        return new DataResource() {

        @Override
        public String getName() {
           return "dummy";
        }

        @Override
        public String getUrl() {
           return "dummy";
        }
        };
    }

    @Override
    public CssResource css() {
        return new CssResource() {

        @Override
        public String getName() {
            return "dummy";
        }

        @Override
        public String getText() {
           return "dummy";
        }
        };
    }
    }

Original comment by [email protected] on 15 May 2012 at 4:56

@GoogleCodeExporter
Copy link
Author

Thanks! It worked for me.

Original comment by [email protected] on 23 May 2012 at 11:51

@GoogleCodeExporter
Copy link
Author

I am trying to use the DateTimePicker in the gwt_incubator and I also get the 
message about the inherited module. It seems that the client directory is not 
in any of the gwt.xml files so gwt would not have access to the ValuePicker.

Is there a workaround to be able to use the DateTimePicker?

Original comment by [email protected] on 9 Sep 2012 at 2:56

@GoogleCodeExporter
Copy link
Author

Lucas, any idea on how to get the styles woring? Most of this class is rather 
deprecate. Thanks in advance!

Original comment by [email protected] on 7 May 2013 at 7:28

@GoogleCodeExporter
Copy link
Author

Lucas, thanks, that worked. 

Now I am still wondering if I should use this solution or not. The incubator is 
said to be deprecated, but on the other hand there is no alternative for a 
spinner in the base of gwt.

I am well on the way with my gwt project but I am starting the get the eerie 
feeling that I am one of the last mohicans using gwt.

Any good advice on this anyone?

Original comment by [email protected] on 13 Oct 2013 at 10:52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant