Announcement

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

    setValue on combobox using setOptionDataSource fires ChangedEvent

    Hi,

    I've got a problem with my combobox. It's firing a changedEvent from code.
    It's using a an option client only data source, a ListGrid as picklistproperties.

    When I have all possible records to show in the dropdown, I do
    Code:
    		datasource.setCacheData(newRecords);
    		if (this.isCreated()) {
    			//Re-populate the new records
    			this.fetchData();
    		}
    When I know in code which record actually should be selected, I do form.setValue(COMBO_NAME, id).
    This causes an ItemChangedEvent to be fired, which I didn't expect because it's code doing a setValue, not a user changing it.


    This is the JS stacktrace onItemChanged.
    The textual value for 'id' is "Take It" which you see here.
    Code:
    isc_FormItem_handleChanged([object Object])@http://127.0.0.1:8888/app/sc/modules/ISC_Forms.js:1389
    isc_c_Class_invokeSuper(null,"handleChanged")@http://127.0.0.1:8888/app/sc/modules/ISC_Core.js:306
    isc_c_Class_Super("handleChanged",[object Arguments])@http://127.0.0.1:8888/app/sc/modules/ISC_Core.js:298
    isc_ComboBoxItem_handleChanged([object Object])@http://127.0.0.1:8888/app/sc/modules/ISC_Forms.js:2793
    isc_FormItem_storeValue([object Object])@http://127.0.0.1:8888/app/sc/modules/ISC_Forms.js:1386
    isc_FormItem__updateValue([object Object])@http://127.0.0.1:8888/app/sc/modules/ISC_Forms.js:1383
    isc_c_Class_invokeSuper(null,"$10y")@http://127.0.0.1:8888/app/sc/modules/ISC_Core.js:306
    isc_c_Class_Super("$10y",[object Arguments])@http://127.0.0.1:8888/app/sc/modules/ISC_Core.js:298
    isc_ComboBoxItem__updateValue("Take It")@http://127.0.0.1:8888/app/sc/modules/ISC_Forms.js:2791
    isc_FormItem_updateValue()@http://127.0.0.1:8888/app/sc/modules/ISC_Forms.js:1381
    19v()@http://127.0.0.1:8888/app/sc/modules/ISC_Forms.js:2216
    dataArrived(0,1,[object Object])@http://127.0.0.1:8888/app/sc/modules/ISC_Forms.js:2226
    setUpPickList(0,1)@http://127.0.0.1:8888/app/sc/modules/ISC_Forms.js:2179
    isc_ListGrid__dataArrived(0,1)@http://127.0.0.1:8888/app/sc/modules/ISC_Grids.js:1283
    anonymous(0,1)@http://127.0.0.1:8888/app/sc/modules/ISC_Core.js:66
    isc_ResultSet__doneDataArriving(0,1,false)@http://127.0.0.1:8888/app/sc/modules/ISC_DataBinding.js:1483
    fetchRemoteDataReply([object Object],[object Array],[object Object])@http://127.0.0.1:8888/app/sc/modules/ISC_DataBinding.js:1424
    isc_c_Class_fireCallback([object Object],"dsResponse,data,dsRequest",[object Array],[object Object],(void 0))@http://127.0.0.1:8888/app/sc/modules/ISC_Core.js:323
    isc_Class_fireCallback([object Object],"dsResponse,data,dsRequest",[object Array])@http://127.0.0.1:8888/app/sc/modules/ISC_Core.js:421
    isc_DataSource_fireResponseCallbacks([object Object],[object Object],[object Object],[object Object])@http://127.0.0.1:8888/app/sc/modules/ISC_DataBinding.js:584
    isc_DataSource__completeResponseProcessing([object Object],[object Object],[object Object],[object Object],[object Object])@http://127.0.0.1:8888/app/sc/modules/ISC_DataBinding.js:581
    isc_DataSource__handleClientOnlyReply([object Object],[object Object],[object Object])@http://127.0.0.1:8888/app/sc/modules/ISC_DataBinding.js:431
    isc_c_Class_fireCallback([object Object],"rpcResponse,data,rpcRequest",[object Array],[object Object],(void 0))@http://127.0.0.1:8888/app/sc/modules/ISC_Core.js:323
    isc_Class_fireCallback([object Object],"rpcResponse,data,rpcRequest",[object Array])@http://127.0.0.1:8888/app/sc/modules/ISC_Core.js:421
    isc_c_RPCManager_fireReplyCallback([object Object],[object Object],[object Object],[object Object])@http://127.0.0.1:8888/app/sc/modules/ISC_DataBinding.js:1312
    (?)([object Object],[object Object],[object Object],[object Object])@http://127.0.0.1:8888:186
    isc_c_RPCManager_fireReplyCallbacks([object Object],[object Object])@http://127.0.0.1:8888/app/sc/modules/ISC_DataBinding.js:1317
    isc_c_RPCManager_performOperationReply([object Object],[object Object])@http://127.0.0.1:8888/app/sc/modules/ISC_DataBinding.js:1311
    isc_c_RPCManager__performTransactionReply(86)@http://127.0.0.1:8888/app/sc/modules/ISC_DataBinding.js:1305
    isc_c_Class_fireCallback([object Object],(void 0),[object Array],[object Object],true)@http://127.0.0.1:8888/app/sc/modules/ISC_Core.js:323
    isc_c_Timer__fireTimeout("$ir589")@http://127.0.0.1:8888/app/sc/modules/ISC_Core.js:1334
    @http://127.0.0.1:8888/app/sc/modules/ISC_Core.js:1329
    Do you share the view that form.setValue calls never should cause an ItemChangedEvent? Where should I be looking for the problem?

    thanks


    SmartClient Version: SC_SNAPSHOT-2011-11-07/Pro Deployment (built 2011-11-07)
    FF4 dev mode

    #2
    Sorry this has way to little context, we can't follow what components are involved here or what the flow is. Try adding more detail, ideally, code we can run to see a problem.

    Comment


      #3
      Yes, sorry. I've created a very minimal similar case, but there I don't have the changed event. So I need to figure out where it could be coming from.

      I had hoped that stacktrace tells you something more than myself :)


      I'll see if I can get to the bottom of the problem.

      Comment


        #4
        The stack trace often does tell us a lot, so it's good to include it. But this case is a bit too convoluted for just the stack trace to be enough - hopefully you will be able to create a standalone case we can look at.

        Comment

        Working...
        X