nihad640 / smartgwt

Automatically exported from code.google.com/p/smartgwt
0 stars 0 forks source link

Problem with a class that extends com.smartgwt.client.widgets.form.fields.SelectItem #657

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.I implemented OwnersMUSelectItem class that extends 
com.smartgwt.client.widgets.form.fields.SelectItem
2.I added some methods
3.Within these methods, I invoke base class methods

What is the expected output? 
The base class methods are invoked

What do you see instead?
I have some exceptions such as com.google.gwt.core.client.JavaScriptException: 
(TypeError): Object #<Object> has no method 'fetchData' 
but not only with I invoke the method fetchData(), if I change the order of 
execution also getSelectedRecords() and all base class methods are not found.

What version of the product are you using?
/builds/SmartGWT/3.1d/LGPL/2012-02-09

On what operating system?
Windows XP, Windows 7 Pro

What browser(s) does this happen in?  
Crome 17.0.963.46 m, FF 8, 9, 10, IE 9.0.4

Please provide any additional information below.
I wanted to get that to dynamically change the selection to change the tooltip, 
Perhaps the attached example contains the code beyond the essentials, but the 
gist is that when I invoke a base class method, I get an exception <Object> 
Object # has no method 'methodName'

thanks in advance

Original issue reported on code.google.com by vlui...@tiscali.it on 9 Feb 2012 at 3:20

Attachments:

GoogleCodeExporter commented 9 years ago
There are some calls in the code which indicate you have not really tested this 
standalone, but instead inside a larger app.  Please actually test standalone 
and provide the revised code (ideally, one file, no unnecessary code).

Also, please let us know whether you can still reproduce this if you do not try 
to register the SelectItem as it's own change handler.

Finally, if there is still a JavaScript error, please include the stack trace 
for the error as shown in the Developer Console - instructions for getting this 
are in the SmartGWT FAQ.

Provisionally marking Invalid until the above is corrected.

Original comment by smartgwt...@gmail.com on 9 Feb 2012 at 7:38

GoogleCodeExporter commented 9 years ago
Thanks for reply, but I reduced the code to circumvent the problem of classes 
derived from SelectItem, if you run the attached code, the Developer Console 
displays an exception caused by the invocation of the method 
getSelectedRecords() from a derived class.
I can do without a derived class from SelectItem, I just wanted to know if I 
had done something wrong.

Thanks 

Original comment by vlui...@tiscali.it on 10 Feb 2012 at 11:39

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry
public class TestCase extends VLayout

Original comment by vlui...@tiscali.it on 10 Feb 2012 at 11:46

GoogleCodeExporter commented 9 years ago
It's not a problem to subclass SelectItem.

This new code is trying to call getSelectedRecords() on a SelectItem that 
doesn't have an optionDataSource, hence no possible source of records - this 
doesn't make sense.

Original comment by smartgwt...@gmail.com on 10 Feb 2012 at 4:58