Announcement

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

    setting MultiComboBoxItem value

    Hello,

    What is the proper way to set MultiComboBoxItem value? getValue() returns the selected items separated by comma, but when we call setValue() using the same string MultiComboBoxItem doesn't recognize it as list of multiple values. Is there a way to add multiple items programmatically?

    We're using Isomorphic SmartClient/SmartGWT Framework (v8.3p_2012-12-20/Enterprise Deployment 2012-12-20)

    #2
    We've now added a setValues() and getValues() call to this class (in 3.1p and 4.0d) so you don't have to parse the delimited string or use setValue(Object).

    Comment


      #3
      Using setValues()

      Hi,

      I have a MultiComboBoxItem which is populated from a datasource (with id and name fields). The display field is the name and value field is id. Setting the ids using the setValues() method, does not show the display value names.
      Instead this warning is thrown in the GWT console when run on hosted mode.


      00:00:50.750 [ERROR] 19:58:44.102:XRP6:WARN:Log:TypeError: _2.find is not a function Stack from error.stack: FormItem.fetchMissingValueReply(_1=>{Obj}, _2=>{Obj}, _3=>{Obj}) @ sc/modules/ISC_Forms.js:782 [c]Class.fireCallback(_1=>{Obj}, _2=>"dsResponse,data,dsRequest", _3=>[object Array], _4=>{Obj}, _5=>undef) @ sc/modules/ISC_Core.js:256 [c]Class.fireCallback(_1=>{Obj}, _2=>"dsResponse,data,dsRequest", _3=>[object Array]) @ sc/modules/ISC_Core.js:311 DataSource.fireResponseCallbacks({Obj}, {Obj}, {Obj}, {Obj}) @ sc/modules/ISC_DataBinding.js:639 DataSource._completeResponseProcessing({Obj}, {Obj}, {Obj}, {Obj}, {Obj}) @ sc/modules/ISC_DataBinding.js:637 DataSource._handleSCServerReply({Obj}, {Obj}, {Obj}) @ sc/modules/ISC_DataBinding.js:1663 [c]Class.fireCallback(_1=>{Obj}, _2=>"rpcResponse,data,rpcRequest", _3=>[object Array], _4=>{Obj}, _5=>undef) @ sc/modules/ISC_Core.js:256 [c]Class.fireCallback(_1=>{Obj}, _2=>"rpcResponse,data,rpcRequest", _3=>[object Array]) @ sc/modules/ISC_Core.js:311 anonymous(callback=>{Obj}, request=>{Obj}, response=>{Obj}, data=>{Obj}) @ sc/modules/ISC_DataBinding.js:1218 unnamed({Obj}, {Obj}, {Obj}, {Obj}) @ :232 [c]RPCManager.fireReplyCallbacks(_1=>{Obj}, _2=>{Obj}) @ sc/modules/ISC_DataBinding.js:1221 [c]RPCManager.performOperationReply(_1=>{Obj}, _2=>{Obj}) @ sc/modules/ISC_DataBinding.js:1218 RPCManager._performTransactionReply(10) @ sc/modules/ISC_DataBinding.js:1212 [c]RPCManager.performTransactionReply(_1=>10, _2=>"//isc_RPCResponseStart-->[{data:{\"3436..."[ 256], _3=>undef) @ sc/modules/ISC_DataBinding.js:1178 anonymous(10, [object XMLHttpRequest]) @ sc/modules/ISC_Core.js:63 [c]Class.fireCallback(_1=>"isc.RPCManager.performTransactionReply(..."[ 67], _2=>"transactionNum,results,wd", _3=>[object Array]) @ sc/modules/ISC_Core.js:256 [c]Comm.performXmlTransactionReply(_1=>10, _2=>[object XMLHttpRequest]) @ sc/modules/ISC_Core.js:918 anonymous([object XMLHttpRequest]) @ sc/modules/ISC_Core.js:63 [c]Class.fireCallback(_1=>"isc.Comm.performXmlTransactionReply(10,..."[ 57], _2=>"xmlHttpRequest", _3=>[object Array], _4=>[object XPCCrossOriginWrapper], _5=>true) @ sc/modules/ISC_Core.js:256 Comm._fireXMLCallback([object XMLHttpRequest], "isc.Comm.performXmlTransactionReply(10,..."[ 57]) @ sc/modules/ISC_Core.js:900 unnamed([object Event]) @ sc/modules/ISC_Core.js:905 handleEvent([object Event]) @ :0 SJOWContentBoundary() @ :0 unnamed() @
      com.smartgwt.client.core.JsObject$SGWT_WARN: 19:58:44.102:XRP6:WARN:Log:TypeError: _2.find is not a function Stack from error.stack: FormItem.fetchMissingValueReply(_1=>{Obj}, _2=>{Obj}, _3=>{Obj}) @ sc/modules/ISC_Forms.js:782 [c]Class.fireCallback(_1=>{Obj}, _2=>"dsResponse,data,dsRequest", _3=>[object Array], _4=>{Obj}, _5=>undef) @ sc/modules/ISC_Core.js:256 [c]Class.fireCallback(_1=>{Obj}, _2=>"dsResponse,data,dsRequest", _3=>[object Array]) @ sc/modules/ISC_Core.js:311 DataSource.fireResponseCallbacks({Obj}, {Obj}, {Obj}, {Obj}) @ sc/modules/ISC_DataBinding.js:639 DataSource._completeResponseProcessing({Obj}, {Obj}, {Obj}, {Obj}, {Obj}) @ sc/modules/ISC_DataBinding.js:637 DataSource._handleSCServerReply({Obj}, {Obj}, {Obj}) @ sc/modules/ISC_DataBinding.js:1663 [c]Class.fireCallback(_1=>{Obj}, _2=>"rpcResponse,data,rpcRequest", _3=>[object Array], _4=>{Obj}, _5=>undef) @ sc/modules/ISC_Core.js:256 [c]Class.fireCallback(_1=>{Obj}, _2=>"rpcResponse,data,rpcRequest", _3=>[object Array]) @ sc/modules/ISC_Core.js:311 anonymous(callback=>{Obj}, request=>{Obj}, response=>{Obj}, data=>{Obj}) @ sc/modules/ISC_DataBinding.js:1218 unnamed({Obj}, {Obj}, {Obj}, {Obj}) @ :232 [c]RPCManager.fireReplyCallbacks(_1=>{Obj}, _2=>{Obj}) @ sc/modules/ISC_DataBinding.js:1221 [c]RPCManager.performOperationReply(_1=>{Obj}, _2=>{Obj}) @ sc/modules/ISC_DataBinding.js:1218 RPCManager._performTransactionReply(10) @ sc/modules/ISC_DataBinding.js:1212 [c]RPCManager.performTransactionReply(_1=>10, _2=>"//isc_RPCResponseStart-->[{data:{\"3436..."[ 256], _3=>undef) @ sc/modules/ISC_DataBinding.js:1178 anonymous(10, [object XMLHttpRequest]) @ sc/modules/ISC_Core.js:63 [c]Class.fireCallback(_1=>"isc.RPCManager.performTransactionReply(..."[ 67], _2=>"transactionNum,results,wd", _3=>[object Array]) @ sc/modules/ISC_Core.js:256 [c]Comm.performXmlTransactionReply(_1=>10, _2=>[object XMLHttpRequest]) @ sc/modules/ISC_Core.js:918 anonymous([object XMLHttpRequest]) @ sc/modules/ISC_Core.js:63 [c]Class.fireCallback(_1=>"isc.Comm.performXmlTransactionReply(10,..."[ 57], _2=>"xmlHttpRequest", _3=>[object Array], _4=>[object XPCCrossOriginWrapper], _5=>true) @ sc/modules/ISC_Core.js:256 Comm._fireXMLCallback([object XMLHttpRequest], "isc.Comm.performXmlTransactionReply(10,..."[ 57]) @ sc/modules/ISC_Core.js:900 unnamed([object Event]) @ sc/modules/ISC_Core.js:905 handleEvent([object Event]) @ :0 SJOWContentBoundary() @ :0 unnamed() @
      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:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) at java.lang.Thread.run(Thread.java:662)

      The GWT version used is Isomorphic SmartClient/SmartGWT Framework (v8.3p_2013-01-28/Pro Deployment 2013-01-28)

      Can you please provide a work around for this issue?

      Comment


        #4
        This suggest your server is sending invalid responses - take a look at the details of the requests and responses in the RPC tab, and if needed, compare to the server responses you see in the sample.

        If you do this and think you've found a framework bug, please post a minimal, ready-to-run test case.

        Comment


          #5
          Problem with selecting records in ListGrid

          Hi,

          To get the set and get Values methods for MultiComboBoxItem, I upgraded the Smart GWT version to v8.3p_2013-01-28/Pro Deployment 2013-01-28. This has now affected the listgrid functionality. The code to delete the selected row,

          if ( listGrid.getSelectedRecord() != null) { //1
          listGrid.removeSelectedData(); //2
          } //3

          Line 1 throws the following exception:

          00:03:04.203 [ERROR] Uncaught exception escaped
          <pre>com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses
          at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
          at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:71)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          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:172)
          at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
          at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
          at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
          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:213)
          at sun.reflect.GeneratedMethodAccessor62.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:172)
          at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
          at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
          at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
          at java.lang.Thread.run(Thread.java:662)
          Caused by: java.lang.ClassCastException: com.smartgwt.client.data.Record cannot be cast to com.smartgwt.client.widgets.grid.ListGridRecord
          at com.smartgwt.client.widgets.grid.ListGrid.getSelectedRecord(ListGrid.java)
          at com.book.client.add.product.ProductTab$10.onClick(ProductTab.java:623)
          at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:101)
          at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:1)
          at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
          at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
          at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
          at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
          at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
          at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:71)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          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:172)
          at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
          at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
          at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
          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:213)
          at sun.reflect.GeneratedMethodAccessor62.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:172)
          at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
          at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
          at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
          at java.lang.Thread.run(Thread.java:662)</pre>

          Can you please let me know if this is a bug and is it fixed in any other daily build?

          Comment


            #6
            Caused by: java.lang.ClassCastException: com.smartgwt.client.data.Record cannot be cast to com.smartgwt.client.widgets.grid.ListGridRecord
            This can happen if you populate a clientOnly DataSource with Record instead of ListGridRecord. But it would happen in older builds as well.

            Comment

            Working...
            X