Announcement

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

    Problem with dependent SelectItems ValueMap

    I´m using SmartGWT2.2, IE8 on Windows7. IDE is eclipse.
    I have the following Problem.
    I have a Grid with custom editors. 4 of the fields have SelectItems as editors.
    Every (SelectItem-)editor has a EditorValueMapFunction set.
    In the showcase it is said, that this function will be excecuted, when the Grid.setValueMap(fieldname, new LinkedHashMap()) is called.

    Debugging showed, that the EditorValueMapFunction is called every time, when a user clicks in a record to edit or clicks in a single editor-field of the record, no matter if the Grid.setValueMap...-statement is called or not. if the statement is called, the EditorValueMApFunction of the specific field is called more than once.

    The resulting Problem is a javascript-exception, because it is tried to change and show the values of the SelectItem at the same time.

    The EditorValueMapFunction will be called on every edit, if it is available/registered for a field.
    Is there a way to force the call being excecuted only when Grid.setValueMap is called?
    The error occurs only the first time when the editor is hit, every following hit will be executed without an error.

    Thanks for spending your time on that one.
    Santiago

    p.s. The Error occurs only when the user clicks in the editor, while entering the editor by "TAB" no error occurs!!!

    Here´s the Stacktrace:
    00:39:52,257 [ERROR] 13:03:07.245:RDQ0:WARN:Log:Error: ''this.formItem' ist Null oder kein Objekt' in http://localhost:8888/webcomponents/...s/ISC_Forms.js at line 1831 PickListMenu.$315(_1=>"", _2=>Obj, _3=>Obj{name:Type}, _4=>0, _5=>0) "var _6=this.getFieldName(_5);_1=this.formItem.formatPickListValue(_1,_6,_2);return this.Super("$315",[_1,_2,_3,_4,_5])" ListGrid.getCellValue(_1=>Obj, _2=>0, _3=>0, _4=>[GridBody ID:isc_PickListMenu_0_body]) [o]GridBody.getCellValue(record=>Obj, rowNum=>0, colNum=>0, gridBody=>[GridBody ID:isc_PickListMenu_0_body]) GridRenderer.$22k(_1=>Obj, _2=>0, _3=>0) GridRenderer.getTableHTML(_1=>undef, _2=>undef, _3=>undef) GridRenderer.getInnerHTML(undef) Class.invokeSuper(_1=>null, _2=>"getInnerHTML", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef) Class.Super(_1=>"getInnerHTML", _2=>Obj{length:1}, _3=>undef) GridBody.getInnerHTML(undef) Canvas.$px(_1=>undef) Canvas.$rd(undef, undef, undef, undef, undef, undef, undef, undef) ** recursed on Class.invokeSuper
    com.smartgwt.client.core.JsObject$SGWT_WARN: 13:03:07.245:RDQ0:WARN:Log:Error:
    ''this.formItem' ist Null oder kein Objekt'
    in http://localhost:8888/webcomponents/...s/ISC_Forms.js
    at line 1831
    PickListMenu.$315(_1=>"", _2=>Obj, _3=>Obj{name:Type}, _4=>0, _5=>0) "var _6=this.getFieldName(_5);_1=this.formItem.formatPickListValue(_1,_6,_2);return this.Super("$315",[_1,_2,_3,_4,_5])"
    ListGrid.getCellValue(_1=>Obj, _2=>0, _3=>0, _4=>[GridBody ID:isc_PickListMenu_0_body])
    [o]GridBody.getCellValue(record=>Obj, rowNum=>0, colNum=>0, gridBody=>[GridBody ID:isc_PickListMenu_0_body])
    GridRenderer.$22k(_1=>Obj, _2=>0, _3=>0)
    GridRenderer.getTableHTML(_1=>undef, _2=>undef, _3=>undef)
    GridRenderer.getInnerHTML(undef)
    Class.invokeSuper(_1=>null, _2=>"getInnerHTML", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef)
    Class.Super(_1=>"getInnerHTML", _2=>Obj{length:1}, _3=>undef)
    GridBody.getInnerHTML(undef)
    Canvas.$px(_1=>undef)
    Canvas.$rd(undef, undef, undef, undef, undef, undef, undef, undef)
    ** recursed on Class.invokeSuper
    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.BrowserChannel.reactToMessages(BrowserChannel.java:1668) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222) at java.lang.Thread.run(Thread.java:619)
    Last edited by SantiagoA; 17 Jun 2010, 03:16. Reason: additional info added

    #2
    The Problem is, that the EditorValueMapFunction is called every time a Editorfield is selected when Grid.setValueMap(Fieldname, new LinkedHashMap()) is set.

    When I set Grid.setValueMap(Fieldname, myOwnValueMapGeneratorFunction) with my own LinkedHashMap and NOT "new LinkedHashMap()" everything works as expected.

    Cheers,
    Santiago

    Comment

    Working...
    X