Announcement

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

    Strange recordList javascript error

    I don't know if i'm just trying to do something tooo funky, but i having some troubles with the values manager of a form.

    When i use the ValuesManager to retrieve a member form of it,

    Code:
    DynamicForm myForm = myValuesManager.getMembers()[0];
    and ask that form for it's RecordList:

    Code:
    RecordList records = myForm.getRecordList();
    everything is working as expected. But, when asking that recordlist for
    it's first record via the simple code:

    Code:
    records.first();
    I get greeted with a nice JavascriptException which says to me:

    Code:
    01:46:51.211 [ERROR] Uncaught exception escaped
    com.google.gwt.core.client.JavaScriptException: (TypeError): self.first is not a function
    fileName: http://localhost:8080
    lineNumber: 321
    stack: ()@http://localhost:8080:321
    @:0 ([object GWTJavaObject],131230,[object GWTJavaObject])
    @http://localhost:8080/crm/crm/hosted.html?crm:56 ([object Object],(void 0))
    @http://localhost:8080:1172 ((function () {var param = {};var event = __gwt_makeJavaInvoke(1)(null, 1769511, param);__gwt_makeJavaInvoke(1)(selfJ, 131230, event);var ret = __gwt_makeJavaInvoke(0)(event, 524290);return !ret;}),[object Object],[object Object])
    @http://localhost:8080:17
    @:0 (null,65563,(function () {var param = {};var event = __gwt_makeJavaInvoke(1)(null, 1769511, param);__gwt_makeJavaInvoke(1)(selfJ, 131230, event);var ret = __gwt_makeJavaInvoke(0)(event, 524290);return !ret;}),[object Object],[object Object])
    @http://localhost:8080/crm/crm/hosted.html?crm:56 ([object Object],(void 0))
    @http://localhost:8080:35 ([object Object],(void 0))
    @http://localhost:8080/crm/crm/sc/modules/ISC_Foundation.js:320 ([object Object],(void 0))@http://localhost:8080/crm/crm/sc/modules/ISC_Foundation.js:322 ([object Object],"click")
    @http://localhost:8080/crm/crm/sc/modules/ISC_Core.js:1467 ([object Object])
    @http://localhost:8080/crm/crm/sc/modules/ISC_Core.js:1327 ([object MouseEvent],(void 0))
    @http://localhost:8080/crm/crm/sc/modules/ISC_Core.js:1314 ([object MouseEvent])
    @http://localhost:8080/crm/crm/sc/modules/ISC_Core.js:1305 ((function (_1, _2) {var _3 = isc.EH;if (isc.Browser.isIE && !_3.$j6) {var _4 = _3.lastEvent;_4.eventType = _3.MOUSE_DOWN;_3.handleMouseDown(null, _3.lastEvent);}if (!_2) {_3.$ku = true;}var _5 = _3.$k5(_1, _2);_3.$ku = false;if (isc.Browser.isSafari) {_5 = true;}return _5;}),[object MouseEvent])
    @http://localhost:8080/crm/crm/sc/modules/ISC_Core.js:1528 anonymous([object MouseEvent])
    @http://localhost:8080/crm/crm/sc/modules/ISC_Core.js:60
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:195)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
    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:188)
    at sun.reflect.GeneratedMethodAccessor276.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.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:637)
    So it seems like the first() function is not available?? Also when trying other functions like for example duplicate(), I get greeted with a similar exception.

    I know i'm trying to do some weird stuff to retrieve a record which was added to the dynamicForm a previous point in time. But i'm wondering what might be the cause of this weird error. Since all the functions i tried on RecordList are present in the SmartGWT class RecordList.

    Thanks in advance,
    David

    PS: The code posted is a simpler explanation of the actual code, which is a littler more compact AND uglier. But for those who want it, with some additional debugging info:

    Code:
    GWT.log("ValuesManager: " + _vm);
    GWT.log("DynamicForm: " + _vm.getMembers()[0]);
    GWT.log("RecordList: " + _vm.getMembers()[0].getRecordList());
    GWT.log("Record: " + _vm.getMembers()[0].getRecordList().first());
    GWT development console prints out:

    Code:
    01:46:48.909 [INFO] ValuesManager: com.smartgwt.client.widgets.form.ValuesManager@aadd1d
    01:46:48.911 [INFO] DynamicForm: <<SmartGWT Component>>::class com.smartgwt.client.widgets.form.DynamicForm, ID:isc_OID_34
    01:46:48.914 [INFO] RecordList: com.smartgwt.client.data.RecordList@174c237
    
    ... and then the stack posted above

    #2
    A ValuesManager really works with only one Record at a time. Instead of trying to use list-oriented APIs, just use getValues().

    Comment

    Working...
    X