Announcement

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

    No data with ValuesManager and fetchData in Firefox(compiled mode)

    I have a problem with Firefox in compiled mode.
    Hosted mode and also IE(compiled mode) work well in this case, SmartClient Developer Console does not show any error.

    I have a
    o Data source
    -- client-only
    -- with some data bound fields
    o ValuesManager
    -- representing several forms (as TabSet)
    o The forms
    -- which use form.setFields to select the databound fields to show on each form.

    After creating the widget, I hook a callback for to do some further initialization after the fetched data is available:
    Code:
    // widget creation...
    
    ValuesManager vm ...;
    vm.fetchData(null, new DSCallback() {
                public void execute(DSResponse response, Object rawData, DSRequest request) {
                                    
                   String vmValue = vm.getValueAsString("myFieldName");
                   // cross check, where's the problem?
                   String formValue = formMode.getValueAsString("myFieldName));
                   
                   // some more initialization work ...
    
                }
            });
    The two variables vmValue and also formValue are both null in Firefox (compiled mode), but are available in IE(compiled mode) and also in Hosted Mode.
    The call
    Code:
    ValuesManager.fetch(...)
    reaches the data source
    Code:
    DataSource->protected Object transformRequest(DSRequest dsRequest)
    with fetch
    Code:
    dsRequest.getOperationType() == DSOperationType.FETCH
    There, in the data source, all data is available. In fact the data source returns a
    Code:
    (ListGridRecord)data[0]
    containing all data.

    Interesting is, that the data itself seems to be bound to the fields, but is not selected. My text field "myFieldName" is visually empty, but I also have some fields of type DataSourceEnumField which are visualized by a SelectItem. Those contain the bound data, but nothing is selected.

    So everything works fine but for Firefox compiled mode. Any ideas? Can I help with further investigation?
    Last edited by ect; 20 Jan 2009, 08:24.

    #2
    Are you seeing any JavaScript errors in Firebug?

    Comment


      #3
      I changed SmartClient DeveloperConsole log level to debug. I think the problem is the value provision to the fields which is different between IE and Firefox.
      I can also sent you the complete traces via mail if required.

      The databound fields for this output are:
      1) name: (TextItem/DataSourceTextField): value: 'Prompt'
      2) further 5 fields of type (SelectItem/DataSourceEnumField), each contains different enum data.


      IE (SmartClient DeveloperConsole)
      Code:
      08:43:54.262:TMR7:INFO:RPCManager:rpcResponse(unstructured) results -->{status: 0}<--
      08:43:54.356:TMR7:INFO:xmlBinding:isc_OID_3:dsResponse is: {status: 0,
      data: Array[1],
      httpResponseCode: undef,
      transactionNum: 0,
      clientContext: undef}
      08:43:54.528:TMR7:INFO:redraws:mode:Scheduling redraw (setValues)
          Canvas.$q9(_1=>"setValues", _2=>undef)
          Canvas.markForRedraw(_1=>"setValues")
          DynamicForm.setValues(_1=>Obj{name:Prompt}, _2=>undef)
          ValuesManager.setValues(_1=>Obj)
          ValuesManager.setData(_1=>Obj{name:Prompt})
              "return this.setValues(_1)"
          EditorActionMethods.$39m(_1=>Obj{name:Prompt})
          EditorActionMethods.editRecord(_1=>Obj{name:Prompt})
              "this.setSaveOperationType("update");this.$39m(_1)"
          DynamicForm.fetchDataReply(_1=>Obj, _2=>Array[1], _3=>Obj)
          Class.fireCallback(_1=>Obj, _2=>"dsResponse,data,dsRequest", _3=>Array[3], _4=>[ValuesManager ID:isc_OID_4], _5=>undef) on [Class Class]
          Class.fireCallback(_1=>Obj, _2=>"dsResponse,data,dsRequest", _3=>Array[3], _4=>undef)
              "return isc.Class.fireCallback(_1,_2,_3,this,_4)"
          DataSource.$38b(_1=>Obj, _2=>Obj, _3=>Obj, _4=>Obj, _5=>Obj)
          DataSource.$50e(_1=>Obj, _2=>Obj, _3=>Obj)
              "var _4=this.getClientOnlyResult(_3),_5=_3.$374;this.$38b(_2,_4,_5,_1,_3)"
          ** recursed on Class.fireCallback
      
      08:43:54.590:TMR8:DEBUG:Page:handleEvent(idle): firing action => 
      08:43:54.700:RDQ0:DEBUG:drawing:clearRedrawQueue: [DynamicForm ID:mode]
      08:43:54.809:RDQ0:INFO:drawing:mode:$ra(): redrawing
      Firefox (SmartClient DeveloperConsole)
      Code:
      08:41:35.419:TMR9:INFO:RPCManager:rpcResponse(unstructured) results -->{status: 0}<--
      08:41:35.754:TMR9:DEBUG:DataSource:isc_OID_35:Direct compare: function toString() {
          [native code]
      }==function () {
          return this.toString__$();
      }
      08:41:36.092:TMR9:INFO:xmlBinding:isc_OID_35:dsResponse is: {status: 0,
      data: Array[0],
      httpResponseCode: undef,
      transactionNum: 1,
      clientContext: undef}
      08:41:36.476:TMR9:INFO:redraws:mode:Scheduling redraw (setValues) [Stack trace logged via Firebug: FBugTrace29]
      08:41:36.865:TMR0:DEBUG:Page:handleEvent(idle): firing action => 
      08:41:37.240:RDQ3:DEBUG:drawing:clearRedrawQueue: [DynamicForm ID:mode]
      08:41:37.579:RDQ3:DEBUG:DynamicForm:mode:blur w/o handler: no item to blur
      08:41:37.922:RDQ3:INFO:drawing:mode:$ra(): redrawing
      Firefox (Firebug)
      Code:
      com_ect_effective_gwt_vcb_client_tree_GwtIcon_onBrowserEvent__Lcom_google_gwt_user_client_Event_2()76020091...ache.html (line 4807)
      com_google_gwt_user_client_DOM_dispatchEventImpl__Lcom_google_gwt_user_client_Event_2Lcom_google_gwt_user_client_Element_2Lcom_google_gwt_user_client_EventListener_2()76020091...ache.html (line 6842)
      com_google_gwt_user_client_DOM_dispatchEventAndCatch__Lcom_google_gwt_user_client_Event_2Lcom_google_gwt_user_client_Element_2Lcom_google_gwt_user_client_EventListener_2Lcom_google_gwt_core_client_GWT$UncaughtExceptionHandler_2()76020091...ache.html (line 6819)
      com_google_gwt_user_client_DOM_dispatchEvent__Lcom_google_gwt_user_client_Event_2Lcom_google_gwt_user_client_Element_2Lcom_google_gwt_user_client_EventListener_2()76020091...ache.html (line 6809)
      com_google_gwt_user_client_impl_DOMImplStandard_dispatchEvent()76020091...ache.html (line 7162)
      hasFireBug()ISC_Core.js (line 735)
      e6()ISC_Core.js (line 728)
      q9()ISC_Core.js (line 1833)
      markForRedraw()ISC_Core.js (line 1828)
      setValues()ISC_Forms.js (line 280)
      setValues()ISC_Forms.js (line 2233)
      setData()ISC_Forms.js (line 2235)
      save()ISC_Data...inding.js (line 1128)
      
      save()ISC_Data...inding.js (line 1128)
      fetchDataReply()ISC_Data...inding.js (line 1158)
      fireCallback()ISC_Core.js (line 255)
      fireCallback()ISC_Core.js (line 346)
      38b()ISC_Data...inding.js (line 430)
      50e()ISC_Data...inding.js (line 298)
      fireCallback()ISC_Core.js (line 255)
      fireCallback()ISC_Core.js (line 346)
      fireReplyCallback()ISC_Data...inding.js (line 866)
      fireReplyCallbacks()ISC_Data...inding.js (line 868)
      performOperationReply()ISC_Data...inding.js (line 865)
      39d()ISC_Data...inding.js (line 861)
      fireCallback()ISC_Core.js (line 255)
      in()ISC_Core.js (line 1050)
      setTimeout()ISC_Core.js (line 1045)

      Comment


        #4
        Those logs show IE receiving a one record response (Array[1]) and Firefox receiving a zero-record response (Array[0]).

        This suggests that something differs between the data or the search criteria applied - can't really tell without a complete test case.

        Comment


          #5
          Solved

          I found the problem while constructing a test case.

          I have my own client-only datasource because I have to do some special handling during update. During my debug sessions, I also added special handling for fetching, and there was the problem:

          Code:
           
          this.valuesManager.fetchData();
          
          ....
          
          public class MyDataSource extends DataSource {
          ...
            @Override
            protected Object transformRequest(DSRequest dsRequest) {
              DSOperationType opType = dsRequest.getOperationType();
              if (DSOperationType.UPDATE == opType) {
                // do this and that
              } else if (DSOperationType.FETCH == opType) {
                DataClass[] data = getTestData();
                ListGridRecord lgr = (ListGridRecord)data[0];            
                // check this and that
                ....
                // HERE is the problem: 
                return data[0];
              }
            }
          
          }
          This still worked in Hosted Mode and also with IE(Compiled Mode), but not with Firefox(Compiled Mode).

          It did not help to instead return the complete test data with
          Code:
          return getTestData();
          I had to propagate it to the parent with
          Code:
          return super.transformRequest(dsRequest);
          As the code variants all worked in Hosted Mode, I'm wondering what the different to Firefox might be. Nevertheless, it works now, so I'm satisfied.

          Comment


            #6
            Were you extending a RestDataSource instead of a just a DataSource? If so, that makes sense, much of the RestDataSource behavior is in it's implementation of tranformRequest.

            Comment


              #7
              I just overwrote transformRequest to have a trigger for my internal data model updates, so I was not expecting any specific data source like RestDataSource as I have a client only data source which directly extends DataSource.

              My error was that for 'fetch' I erroneously returned the wrong object instead of just returning
              Code:
              dsRequest.getData()
              Still I was curious why this showed different behaviour in the different compiled/hosted modes.

              Comment

              Working...
              X