Go Back   SmartClient Forums > Smart GWT Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 16th May 2011, 09:43
msturzen msturzen is offline
Registered Developer
 
Join Date: Oct 2010
Posts: 63
Default SGWT 2.5 Regression in FilterBuilder?

- SGWT Version: SC_Snapshot-2011-05-14 (Power)
- Hosted mode
- gwt Version: 2.1.1, 2.2.0
- Browser: Firefox 4, IE8
- OS: Win 7 , Mac OS X
- DB: Oracle 10.2, Driver: ojdbc14

Test case:
Create a simple FilterBuilder backed by a (sql) dataSource

Our observation:
When creating a new filter builder the client receives an error.
Unfortunately I'm unable to paste more detail from the console, because it doesn't display correctly (unable to scroll, flickering, ....).

Client side log:
Code:
[ERROR] [Sgwt25_checks] - 19:39:27.926:MUP9:WARN:FilterBuilder:isc_FilterBuilder_0:should've just set filterClause.filterBuilder!

19:39:27.928 [ERROR] [Sgwt25_checks] 19:39:27.926:MUP9:WARN:FilterBuilder:isc_FilterBuilder_0:should've just set filterClause.filterBuilder!
com.smartgwt.client.core.JsObject$SGWT_WARN: 19:39:27.926:MUP9:WARN:FilterBuilder:isc_FilterBuilder_0:should've just set filterClause.filterBuilder!
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:129)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.smartgwt.client.widgets.form.FilterBuilder.create(FilterBuilder.java)
    at com.smartgwt.client.widgets.BaseWidget.getOrCreateJsObj(BaseWidget.java:361)
    at com.smartgwt.client.widgets.Window.addItem(Window.java:1311)
    at de.mwea.sgwt25.client.Sgwt25_checks$MyFilterBuilder.<init>(Sgwt25_checks.java:69)
    at de.mwea.sgwt25.client.Sgwt25_checks$1.onClick(Sgwt25_checks.java:45)
    at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:99)
    at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:1)
    at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.fireEvent(HandlerManager.java:65)
    at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.access$1(HandlerManager.java:53)
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:178)
    at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:67)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:129)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    at java.lang.Thread.run(Unknown Source)
Test Case's onModuleLoad:
Code:
	public void onModuleLoad() {
	
		final ToolStrip ts = new ToolStrip();
		
		
		// Filter Builder
		final ToolStripButton addFilter = new ToolStripButton("Filter");
		addFilter.setID("AddFilter");
		addFilter.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				new MyFilterBuilder().show();
			}
		});
		
		ts.addButton(addFilter);
		
		RootPanel.get("clobTest").add(ts);
	}
	
	private class MyFilterBuilder extends Window {
		public MyFilterBuilder() {

			setHeight(600);
			setWidth(750);
			setTitle("My FilterBuilder");
			setShowCloseButton(true);
			setShowMinimizeButton(false);
			setShowMaximizeButton(false);
			
			// Create FilterBuilder
			final FilterBuilder filterBuilder = new FilterBuilder();
			filterBuilder.setTop(40);
			filterBuilder.setDataSource(DataSource.get("VTM_DEFECT_INFO"));
			
			addItem(filterBuilder);
		}
	}
Reply With Quote
  #2  
Old 16th May 2011, 12:49
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 30,598
Default

This warning should actually be safe to ignore and has now been removed (it will not be present in nightly builds going forward).

Are you actually seeing user-visible ill effects in your app, or is the bug just that this warning is showing up in the console?

Thanks
Isomorphic Software
Reply With Quote
  #3  
Old 17th May 2011, 06:55
msturzen msturzen is offline
Registered Developer
 
Join Date: Oct 2010
Posts: 63
Default

Testing with nightly 2011-05-17:
Warning does not occur anymore, but we see the following behaviour:

When adding a new filter clause an error message comes up, and the log says:

Code:
16:54:12.472 [ERROR] [Sgwt25_checks] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (String): Invoking an instance method on a null instance
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.google.gwt.dev.shell.ModuleSpace.createJavaScriptException(ModuleSpace.java:70)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:60)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:129)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.smartgwt.client.widgets.form.FilterBuilder.getValueFieldProperties(FilterBuilder.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:129)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
    at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    at java.lang.Thread.run(Unknown Source)
Reply With Quote
  #4  
Old 17th May 2011, 07:04
msturzen msturzen is offline
Registered Developer
 
Join Date: Oct 2010
Posts: 63
Default

The error comes up only in Hosted mode. If I access the testcase through eclipse-gwt-plugin's jetty without the postfix "?gwt.codesvr=..." everything is ok.
Reply With Quote
  #5  
Old 17th May 2011, 07:57
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 30,598
Default

In what browsers in hosted mode are you seeing the problem? More than one?
Reply With Quote
  #6  
Old 17th May 2011, 09:28
msturzen msturzen is offline
Registered Developer
 
Join Date: Oct 2010
Posts: 63
Default

Tested and confirmed with IE8, Firefox 3.6
Reply With Quote
  #7  
Old 17th May 2011, 15:36
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 30,598
Default

We're not reproducing this from a rapid test.

The test case you posted isn't completely standalone: Of course we don't have your VTM_DEFECT_INFO dataSource so we're testing with a simple clientOnly dataSource, and we're not duplicating the fields from your DS, etc.

Could you try modifying your example to use a simple inline DataSource definition and show us the modified code so we can run it on our end (assuming it still causes the bug).
If this makes the issue go away, can you show us your DataSource definition and bootstrap file (so we can see how its loaded).
Reply With Quote
  #8  
Old 18th May 2011, 02:26
msturzen msturzen is offline
Registered Developer
 
Join Date: Oct 2010
Posts: 63
Default

Retested with inline DataSource (used one from the showcase) and can confirm your finding. Can't reproduce the error.

So I started to play around with our DataSource.

The results:
We restrict the validOperators for each field. When using these restrictions and selecting a number field (like "Votes") the JS-error pops up. If DS doesn't restrict validOperators no error comes up.

See attached DS for a sample. Just replace VTM_DEFECT_INFO with the new one. I apologize for not sending the ds.xml previously.
Attached Files
File Type: xml SAMPLE_DS.ds.xml (3.0 KB, 15 views)
Reply With Quote
  #9  
Old 19th May 2011, 09:44
msturzen msturzen is offline
Registered Developer
 
Join Date: Oct 2010
Posts: 63
Default

Any new findings?
Reply With Quote
  #10  
Old 26th May 2011, 10:22
msturzen msturzen is offline
Registered Developer
 
Join Date: Oct 2010
Posts: 63
Default

New found strange behaviour of the FuilterBuilder:

gwt: 2.3
sgwt: 2.5 nightly 2011-05-25 (power)
browsers: IE8 (win), Firefox (mac)
language: german

1.) Open a Filterbuilder and add several new criteria, one of them a subclause.
If you hover the "remove" buttons no tooltip will come up, unless fpr the subclause. This is true at least for the german L18N of sgwt. If it's just a missing translation, which key do I have to update in 99translations?

2.) Create a FilterBuilder backed by a sql Datasource.
- Make sure the table contains (var)char, numeric and date(time) columns.
- You can setup Criteria just fine. Then "save" the FilterBuilder and load it again using either button of the attached testcase.
- After reloading you will notice, that Criteria of String-columns reloaded as expected, but Criteria of date and number fields are reset.

Logs show no error.
Since FilterBuilder behaves the same way, no matter how you set its initial Criteria (via JSON.decode/JSON.encode or setting AdvancedCriteria directly) is guess something is wrong within FilterBuilder.


Additional Information:
DataSource
Code:
 
<DataSource 
	schema="SGWT25_SCHEMA"
	dbName="Oracle"
	tableName="SAMPLE_TABLE"
	ID="SAMPLE_DS"
	dataSourceVersion="1"
	serverType="sql"
	autoDeriveSchema="true"/>
HTML File
Code:
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link type="text/css" rel="stylesheet" href="Sgwt25_checks.css">
    <title>SmartGWT 2.5 Tests</title>
    
	<script>var isomorphicDir = "Sgwt25_checks/sc/";</script>
    <script type="text/javascript" language="javascript" src="Sgwt25_checks/Sgwt25_checks.nocache.js"></script>
  </head>

  <body>
    <script src="Sgwt25_checks/sc/DataSourceLoader?dataSource=SAMPLE_DS, MY_OTHER_DS"></script>
    <LINK href="Sgwt25_checks/sc/skins/Enterprise/skin_styles.css" rel="stylesheet" type="text/css">

   
    <!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
    <noscript>
      <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
        Your web browser must have JavaScript enabled
        in order for this application to display correctly.
      </div>
    </noscript>

    <h1>SmartGWT 2.5 Tests</h1>
	<div id="clobTest">
	</div>
  </body>
</html>
gwt.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='Sgwt25_checks'>
  <inherits name="com.google.gwt.user.User"/>
  <inherits name="com.google.gwt.i18n.I18N"/>
  <extend-property name="locale" values="de"/>
  <inherits name="com.google.gwt.i18n.CldrLocales"/>
  <set-property-fallback name="locale" value="de"/>
  <set-property name="user.agent" value="ie8" /> 
  <inherits name="com.smartgwtpower.SmartGwtPower" />
  <inherits name="com.smartgwtpower.tools.Tools"/>
  <entry-point class='de.mwea.sgwt25.client.Sgwt25_checks'/>
  <source path='client'/>
  <source path='shared'/>
</module>
Attached Files
File Type: java Sgwt25_checks.java (4.6 KB, 5 views)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
SGWT 2.5 Regression in CLOB handling? msturzen Smart GWT Technical Q&A 8 18th May 2011 07:31
SGWT 2.5: No built-in validator named '' was found. tmoes Smart GWT Technical Q&A 1 18th May 2011 06:27
Page size with a RestDataSource and FilterBuilder fbdo Smart GWT Technical Q&A 2 5th May 2010 10:39
FilterBuilder & ComboBoxItem michalg Smart GWT Technical Q&A 6 22nd Apr 2010 01:11
How to programmatically add a clause to FilterBuilder? mjmars42 Smart GWT Technical Q&A 8 13th Apr 2010 10:53

© 2010,2011 Isomorphic Software. All Rights Reserved