Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    setEditorValueMapFunction() & groupBy() issue with smartgwtpro 2.4

    Hi

    I get an exception by using ListGridField method setEditorValueMapFunction(EditorValueMapFunction editorValueMapFunction) and ListGrid groupBy(java.lang.String... fields) method altogether. The exception occurs by using the new smartgwt pro 2.4. Exception doesn't happen with smartgwt pro 2.3.
    I suppose there is a bug on the new version of smartgwt pro: You could just verify this by adding the following line into GridDependentSelectsSample.java smartgwt sample:

    Code:
     localDataGrid.groupBy("division");
    You can put it for example before the line
    Code:
     layout.addMember(localDataGrid);
    The Browser Version is Firefox 3.5.16.

    When I run the changed sample and double click on a row to edit it, I get the following Exception:

    [ERROR] Uncaught exception escaped
    com.google.gwt.core.client.JavaScriptException: (InternalError): too much recursion
    fileName: http://127.0.0.1:8888 lineNumber: 118
    stack: ("division")@http://127.0.0.1:8888:118
    ([object Object])@http://127.0.0.1:8888:146
    ([object Array])@http://127.0.0.1:8888:127
    ([object Object])@http://127.0.0.1:8888:146
    ([object Object])@http://127.0.0.1:8888:146
    ([object Array])@http://127.0.0.1:8888:127
    ([object Object])@http://127.0.0.1:8888:146
    ...
    (again and again approximately 3000 lines)
    ...
    ([object Array])@http://127.0.0.1:8888:127
    ([object Object])@http://127.0.0.1:8888:146
    ([object Object])@http://127.0.0.1:8888:146
    ([object Object],false)@http://127.0.0.1:8888:146
    ([object Object],false)@http://127.0.0.1:8888:369
    @:0
    (null,393486,[object Object])@http://127.0.0.1:8888/showcase/hosted.html?showcase:56
    ([object Object],[object Object],[object Object])@http://127.0.0.1:8888:245
    ((function (values, field, grid) {var valuesJ = __gwt_makeJavaInvoke(1)(null, 393486, values);var fieldJ = __gwt_makeJavaInvoke(1)(null, 9109794, field);var gridJ = __gwt_makeJavaInvoke(1)(null, 1508190, grid);var map = __gwt_makeJavaInvoke(3)(editorValueMapFunction, 12713986, valuesJ, fieldJ, gridJ);return __gwt_makeJavaInvoke(1)(null, 393402, map);}),[object Object],[object Object])@http://127.0.0.1:8888:18
    @:0
    (null,65642,(function (values, field, grid) {var valuesJ = __gwt_makeJavaInvoke(1)(null, 393486, values);var fieldJ = __gwt_makeJavaInvoke(1)(null, 9109794, field);var gridJ = __gwt_makeJavaInvoke(1)(null, 1508190, grid);var map = __gwt_makeJavaInvoke(3)(editorValueMapFunction, 12713986, valuesJ, fieldJ, gridJ);return __gwt_makeJavaInvoke(1)(null, 393402, map);}),[object Object],[object Object])@http://127.0.0.1:8888/showcase/hosted.html?showcase:56 ([object Object],[object Object],[object Object])@http://127.0.0.1:8888:58 isc_ListGrid_getEditorValueMap([object Object],[object Object])@http://127.0.0.1:8888/showcase/sc/modules/ISC_Grids.js:1835 isc_ListGrid_getEditItem([object Object],[object Object],[object Object],1,2,158)@http://127.0.0.1:8888/showcase/sc/modules/ISC_Grids.js:1866 isc_ListGrid_getEditRowItems([object Object],1,1,(void 0))@http://127.0.0.1:8888/showcase/sc/modules/ISC_Grids.js:1846 isc_ListGrid_makeEditForm(1,1)@http://127.0.0.1:8888/showcase/sc/modules/ISC_Grids.js:1823 isc_ListGrid_showInlineEditor(1,1,true,true,null)@http://127.0.0.1:8888/showcase/sc/modules/ISC_Grids.js:1787 isc_ListGrid__startEditing(1)@http://127.0.0.1:8888/showcase/sc/modules/ISC_Grids.js:1776 isc_c_Class_fireCallback([object Object],(void 0),[object Array],[object Object],true)@http://127.0.0.1:8888/showcase/sc/modules/ISC_Core.js:318 isc_c_Timer__fireTimeout("$ir211")@http://127.0.0.1:8888/showcase/sc/modules/ISC_Core.js:1241 @http://127.0.0.1:8888/showcase/sc/modules/ISC_Core.js:1236
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
    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.GeneratedMethodAccessor27.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    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(Thread.java:662)

    I would appreciate, if someone checks this.

    Ts. Vasilev
    Last edited by abundm; 31 Jan 2011, 06:50.

    #2
    Hi Ts. Valsilev,
    Thanks for the report - we've checked it out and it is indeed a bug.
    We've applied a fix to our mainline codebase which will show up in nightly builds from this point forward
    Check the next nightly (Feb 2) and let us know if you continue to see this problem

    Regards
    Isomorphic Software

    Comment


      #3
      It works.
      Thanks a lot for your quick response.

      Best Regards
      Ts. Vasilev

      Comment


        #4
        I have similar problem to the problem posted by Ts. Vasilev.

        I started with the Dependent Selects (Grid) example from SmartGWT Showcase and then I changed the code.

        Although I don't use groupBy method in my code, I get "too much recursion" Exception when clicking on the column on which setEditorValueMapFunction was used. This happens when I compile code with smartgwt-2.4.jar. If I use nightly build (eg. 2011-04-19), the dependent select works ok. However there are other issues with the rest of my application when it is used with the nightly build of SmartGWT, so I don't want to use the nightly build. Could you tell me if there is any workaround for the "too much recursion" problem, so that setEditorValueMapFunction works correctly with the SmartGWT version 2.4? Could you tell me how was the SmartGWT code fixed in February?

        If the above workaround is not possible, what are my other options?
        Is there another way to set the valueMap for the SelectItem in ListGrid before the user starts the edit? I tried using addFocusHandler on SelectItem or addEditorEnterHandler on ListGridField. I set the editorValueMap in the handler. It doesn't work, because the user has to click on the column (thus entering the editor), then exit the editor and enter the editor again. When the editor is shown for the first time the values are not changed. When the editor is shown for the second time, I can see the possible values set by the editorValueMap in the FocusHandler (or EditorEnterHandler).

        EDIT:

        I found the Handler I was looking for. It's called RecordClickHandler. The following code works (ie. the correct dependent values are shown while entering the editor for the first time):

        Code:
        	ListGridField attrNameField = new ListGridField("attrName","Name");
                fields.add(attrNameField);
                
                final ListGridField attrValueField = new ListGridField("attrValue","Value");
                final SelectItem attrValueSelectItem = new SelectItem();  
                attrValueSelectItem.setAddUnknownValues(false);
                attrValueField.addRecordClickHandler(new RecordClickHandler() {
                    
                    @Override
                    public void onRecordClick(RecordClickEvent event) {
                        String attrName = event.getRecord().getAttributeAsString("attrName");
                        LinkedHashMap<String, String> map;
                        // here comes the logic to create LinkedHashMap which depends on attrName
                        // ...
                        attrValueField.setEditorValueMap(map);
                    }
                });
                
                attrValueField.setEditorType(attrValueSelectItem);
                fields.add(attrValueField);
        I would still like to know how to fix the "too much recursion" problem, so that I can use setEditorValueMapFunction instead of RecordClickHandler.

        --
        tafit3
        Last edited by tafit3; 20 Apr 2011, 04:28.

        Comment

        Working...
        X