Hello Guys,
I am writing some code that dynamically modifies a tree. How it works is:
1. User Clicks on a combo box and enters a regular expression
2. On keypress (enter) the data is sent back to the server to set it in session
3. A tree holding some data is refreshed (so that the server sends back the relavant filtered data) [This step cannot be done on the client for a variety of reasons]
The setting of the filter, and the server side code works perfectly. Cause if i pass the filter via a url before the page is loaded, it shows properly filtered data.
However when i try to change it via the combo box, it fails.
And i get a wierd error on the combo box instead of the tree.
Some Code samples:
The code to set the filter and reload the tree
The Tree refreshing code: I am not exactly sure what all to provide from here, since its a lot of code. I am hoping for some pointers from the general picture that i painted, and can provide proper code samples to take it further. (I am still trying to recreate a standalone setup that can also reproduce the problem.)
1. Smart GWT 2.3, on chrome in hosted mode (Havent tried it in compiled mode)
2. Developer Console Trace:
Posting in a separate post below (Cause its huge)
3. Full Stack Trace from the eclipse console:
18:42:50.532 [ERROR] [com.jpmorgan.monitron.MonitronGUIPOC] 18:42:50.512:MDN2:WARN:Log:TypeError: Object [DynamicForm ID:isc_DynamicForm_0] has no method 'getFocusSubItem'
com.smartgwt.client.core.JsObject$SGWT_WARN: 18:42:50.512:MDN2:WARN:Log:TypeError: Object [DynamicForm ID:isc_DynamicForm_0] has no method 'getFocusSubItem'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
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.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(Thread.java:662)
Thanks and Regards,
Basil Dsouza
I am writing some code that dynamically modifies a tree. How it works is:
1. User Clicks on a combo box and enters a regular expression
2. On keypress (enter) the data is sent back to the server to set it in session
3. A tree holding some data is refreshed (so that the server sends back the relavant filtered data) [This step cannot be done on the client for a variety of reasons]
The setting of the filter, and the server side code works perfectly. Cause if i pass the filter via a url before the page is loaded, it shows properly filtered data.
However when i try to change it via the combo box, it fails.
And i get a wierd error on the combo box instead of the tree.
Some Code samples:
The code to set the filter and reload the tree
Code:
final ComboBoxItem filterInput = new ComboBoxItem("Filter"); filterInput.setType("comboBox"); filterInput.setWidth(200); filterInput.setShowTitle(true); filterInput.setDefaultValue(filterPattern); filterInput.setValueMap("Test"," test 2", "test 4" , "test 5"); filterInput.addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(KeyPressEvent event) { if(!"Enter".equalsIgnoreCase(event.getKeyName())){ return; } System.out.println("On key press handler called."); String currFilterVal = filterInput.getValueAsString(); FilterServiceAsync service = GWT.create(FilterService.class); service.setActiveFilter(new FilterDTO("Ad Hoc", currFilterVal), new AsyncCallback<Void>() { @Override public void onSuccess(Void result) { drillDownContainer.refreshData(); // This is a custom container inheriting from VLayout, mostly irrelevant to this problem drillDownTree.recreateTree(); // This is a function i wrote to remove all the children of the tree and reload it from the server. } @Override public void onFailure(Throwable caught) { com.google.gwt.user.client.Window.alert("Filter setting failed: " + caught); } }); } });
1. Smart GWT 2.3, on chrome in hosted mode (Havent tried it in compiled mode)
2. Developer Console Trace:
Posting in a separate post below (Cause its huge)
3. Full Stack Trace from the eclipse console:
18:42:50.532 [ERROR] [com.jpmorgan.monitron.MonitronGUIPOC] 18:42:50.512:MDN2:WARN:Log:TypeError: Object [DynamicForm ID:isc_DynamicForm_0] has no method 'getFocusSubItem'
com.smartgwt.client.core.JsObject$SGWT_WARN: 18:42:50.512:MDN2:WARN:Log:TypeError: Object [DynamicForm ID:isc_DynamicForm_0] has no method 'getFocusSubItem'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
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.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(Thread.java:662)
Thanks and Regards,
Basil Dsouza
Comment