digideskio / google-web-toolkit-incubator

Automatically exported from code.google.com/p/google-web-toolkit-incubator
0 stars 0 forks source link

value spinner when added to a panel throws exception #387

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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 kbvsuren...@gmail.com on 11 Aug 2011 at 4:24

GoogleCodeExporter commented 8 years ago
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 barathT...@gmail.com on 24 Dec 2011 at 2:03

GoogleCodeExporter commented 8 years ago
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 donatien...@gmail.com on 6 Mar 2012 at 5:25

GoogleCodeExporter commented 8 years ago
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 lucasn...@gmail.com on 15 May 2012 at 4:56

GoogleCodeExporter commented 8 years ago
Thanks! It worked for me.

Original comment by amay...@gmail.com on 23 May 2012 at 11:51

GoogleCodeExporter commented 8 years ago
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 nr...@mts.net on 9 Sep 2012 at 2:56

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

Original comment by nic...@gmail.com on 7 May 2013 at 7:28

GoogleCodeExporter commented 8 years ago
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 asim...@gmail.com on 13 Oct 2013 at 10:52