Announcement

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

    #16
    There you go:

    01:48:44.868:TMR8:WARN:Log:findByKeys: dataSource 'isc_OID_18' does not have primary keys declared, can't find record
    Declare a primary key in your DataSource.

    Comment


      #17
      Here is the IE log

      Good morning, sleep mode off :-)

      The data source involved should have his primary key defined, but maybe there is some mistake somewhere.

      The log of my test case is attached (added some logWarn to describe data source fields name and "primary key" property settings):
      The optional data source bound to the ComboBox is costructed as follows:

      Code:
      public class TipiVoceBaseDS extends GwtRpcDataSource {
          public static String DATA_SOURCE_ID = "TipiVoceBaseDS";
          private static TipiVoceBaseDS _instance = null;
      
          public static TipiVoceBaseDS getInstance() {
             if (_instance == null) {
                  _instance = new TipiVoceBaseDS(DATA_SOURCE_ID);
              }
      
              return _instance;
          }
      
          public TipiVoceBaseDS (String p_id) {
              setID(p_id);
      
              DataSourceTextField _hiddenTxtF = new DataSourceTextField("hidden");
              _hiddenTxtF.setPrimaryKey(true);
              _hiddenTxtF.setHidden(true);
              addField(_hiddenTxtF);
         .... 
         (snip other fields)
      The ListGrid data source is like this:
      Code:
      public class VociBudgetBaseDS extends GwtRpcDataSource {
      	public static String DATA_SOURCE_ID = "VociBudgetBaseDS";
      	private static VociBudgetBaseDS _instance = null;
      	private static TipiVoceBaseDS _tvbDS = null;
      	public static VociBudgetBaseDS getInstance() {
      		if (_instance == null) {
      			_instance = new VociBudgetBaseDS(DATA_SOURCE_ID);
      		}
      		if (null == _tvbDS) {
      			_tvbDS = new TipiVoceBaseDS(TipiVoceBaseDS.DATA_SOURCE_ID);
      		}
      		return _instance;
      	}
          public VociBudgetBaseDS (String p_id) {
              setID(p_id);
              DataSourceTextField _hiddenTxtF = new DataSourceTextField("hidden");
              _hiddenTxtF.setPrimaryKey(true);
              _hiddenTxtF.setHidden(true);
              addField(_hiddenTxtF);
        .... 
         (snip other fields)
      Do you see something wrong?

      Thank you very much for your kind help.
      falco
      Attached Files

      Comment


        #18
        same issue in Ubuntu + Firefox

        We have reproduced the same exception in a new test with two different datasource in Ubuntu+Firefox.
        The number of source line that raises the exception is 835, inside the native function added in revision r360 I suppose.

        Code:
            /**
             * Returns the entire record object associated with the current value for this item (or null if no matching record exists
             * in the PickList data). Most commonly used for databound pickListItems to retrieve the values of other fields in the record.
             *
             * @return the selected record or null
             */
            public native ListGridRecord getSelectedRecord() /*-{
                    var self = this.@com.smartgwt.client.core.DataClass::getJsObj()();
                    var ret = self.getSelectedRecord();
                    if(ret == null || ret === undefined) return null;
                    var retVal = @com.smartgwt.client.core.RefDataClass::getRef(Lcom/google/gwt/core/client/JavaScriptObject;)(ret);
                    if(retVal == null) {
                        retVal = @com.smartgwt.client.widgets.grid.ListGridRecord::new(Lcom/google/gwt/core/client/JavaScriptObject;)(ret);
                    }
                    return retVal;
                }-*/;

        Comment


          #19
          Please provide a standalone test case.

          I am not able to reproduce this. I modified the DataBound Dependent ComboBox showcase example as follows and it works just fine.

          Code:
          ButtonItem buttonItem = new ButtonItem("bi", "Get Record");
          buttonItem.addClickHandler(new ClickHandler() {
              public void onClick(ClickEvent event) {
                  Record categoryRecord = categoryItem.getSelectedRecord();
                  Record itemRecord = itemName.getSelectedRecord();
                  String selectedCategory = categoryItem.getAttribute("categoryName");
                  String selectedItem = itemRecord.getAttribute("itemName");
              }
          });
          
          form.setItems(categoryItem, itemName, buttonItem);
          Sanjiv

          Comment


            #20
            sorry

            I'm afraid I am not able to extract a standalone test case since a database server is envolved.
            I tried again with last build (523) and the issue is still there.
            I attached the complete Developer Console Log with the stack trace included.
            Can anybody suggest which trace level setting in developer console might help identifying the problem?

            TIA
            falco
            Attached Files

            Comment


              #21
              Hello falco,

              Use a client-only DataSource or similar approach to create a standalone test case.

              We have a test case where this works fine (and many others for SmartClient besides) so there's not a lot we can do about this until you have created a test case.

              Comment


                #22
                test case

                I posted some attachments to the following issue:

                http://code.google.com/p/smartgwt/issues/detail?id=233

                Please let me know if there is something missing or wrong in the example.

                TIA,
                falco

                Comment


                  #23
                  I think I am getting the same error:
                  Code:
                  Uncaught JavaScript exception [com.google.gwt.core.client.JavaScriptException: (TypeError): Object doesn't support this property or method
                   number: -2146827850
                   description: Object doesn't support this property or method
                  	at net.esteh.acc.client.ui.util.ComboBoxItem.getSelectedRecord(Native Method)
                  When used in other places (like normal form item) it works fine. But when I set this ComboBox as editorType in ListGrid I am getting this exception in onChanged handler.

                  Comment


                    #24
                    Same problem with SelectItem in build 548

                    I tried replacing ComboBoxItem with SelectItem, but without luck:
                    Code:
                    				final SelectItem _funzIdCbo = new SelectItem(_funzIdLGF.getName());
                    				_funzIdCbo.setOptionDataSource(FunzionalitaBaseDS.getInstance());
                    				_funzIdCbo.setEmptyDisplayValue("{vuoto}");
                    				_funzIdCbo.setDisplayField(FunzionalitaBase.REF + Constants.PROPERTY_SEPARATOR+FunzionalitaBase.PROP_FUNZ_DESCRIZIONE);
                    				_funzIdCbo.setValueField(FunzionalitaKey.REF + Constants.PROPERTY_SEPARATOR+FunzionalitaKey.PROP_FUNZ_ID);
                    				_funzIdCbo.setAllowEmptyValue(true);
                    				DataSourceField[] _dsFields = FunzionalitaBaseDS.getInstance().getFields();
                    				ListGridField[] _comboFields = new ListGridField[_dsFields.length];
                    				int _totWidth = 0;
                    				for (int c = 0; c < _comboFields.length; c++) {
                    					int f;
                    					if (_dsFields[c].getName().equals(_funzIdCbo.getDisplayField())) {
                    						f = 0;
                    					} else {
                    						if (null == _comboFields[0]) {
                    							f = c+1;
                    						} else {
                    							f = c;
                    						}
                    					}
                    					_comboFields[f] = new ListGridField(_dsFields[c].getName());
                    					_comboFields[f].setHidden(_dsFields[c].getHidden());
                    					_comboFields[f].setWidth(SSBListGrid.calculateWidth(_dsFields[c]));
                    					if(!_dsFields[c].getHidden())
                    					{
                    						_totWidth = _totWidth + Integer.parseInt( _comboFields[f].getWidth());
                    					}
                    				}
                    				_funzIdCbo.setPickListFields(_comboFields);
                    				_funzIdCbo.setPickListWidth(_totWidth + 20 );
                    				_funzIdCbo.addChangedHandler(new ChangedHandler(){
                    
                    				public void onChanged(ChangedEvent event) {
                    					// TODO Auto-generated method stub
                    					Util.debug("cbo changed:  new " +event.getValue(), false);
                    					Util.debug("changed getSelectedRecord", false);
                    					ListGridRecord _lgr;
                    					final FunzionalitaBaseLGR _recFUNZ;
                    					try {
                    						_lgr = _funzIdCbo.getSelectedRecord();
                    					} catch (Exception ex) {
                    						Util.debug(ex.getMessage(), false);
                    						StackTraceElement[] _st = ex.getStackTrace();
                    						for (int s=0; s < _st.length; s++) {
                    							Util.debug(_st[s].getClassName()+ _st[s].getMethodName() + _st[s].getLineNumber(), false);
                    						}
                    						Util.errore(ex.getMessage(), false);
                    						ex.printStackTrace();
                    						try {
                    							_lgr = new FunzionalitaBaseLGR(new FunzionalitaBase(event.getValue().toString()));
                    						} catch (StringValueSettingException e) {
                    							// TODO Auto-generated catch block
                    							e.printStackTrace();
                    						} catch (DateValueSettingException e) {
                    							// TODO Auto-generated catch block
                    							e.printStackTrace();
                    						} catch (NumberValueSettingException e) {
                    							// TODO Auto-generated catch block
                    							e.printStackTrace();
                    						}
                    					}
                    				}});
                    raised (in GWT Shell IE Win)

                    Code:
                    ...
                    20:25:47.312:MUP5:WARN:Log:cbo changed:  new TIPO_EVE7
                    20:25:47.331:MUP5:WARN:Log:changed getSelectedRecord
                    20:25:47.357:MUP5:WARN:Log:(TypeError): Proprietà o metodo non supportati dall'oggetto
                     number: -2146827850
                     description: Proprietà o metodo non supportati dall'oggetto
                    20:25:47.378:MUP5:WARN:Log:com.smartgwt.client.widgets.form.fields.SelectItemgetSelectedRecord-2
                    20:25:47.401:MUP5:WARN:Log:com.digitalage.ssb.client.datapanel.FunzRelAppEDPanel$4onChanged334
                    20:25:47.457:MUP5:WARN:Log:com.smartgwt.client.widgets.form.fields.events.ChangedEventdispatch96
                    20:25:47.473:MUP5:WARN:Log:com.smartgwt.client.widgets.form.fields.events.ChangedEventdispatch1
                    20:25:47.488:MUP5:WARN:Log:com.google.gwt.event.shared.HandlerManager$HandlerRegistryfireEvent65
                    20:25:47.506:MUP5:WARN:Log:com.google.gwt.event.shared.HandlerManager$HandlerRegistryaccess$153
                    20:25:47.522:MUP5:WARN:Log:com.google.gwt.event.shared.HandlerManagerfireEvent178
                    20:25:47.537:MUP5:WARN:Log:com.smartgwt.client.core.DataClassfireEvent190
                    ...
                    and in Firefox

                    Code:
                    20:37:54.947:WARN:Log:cbo changed:  new HELP8
                    20:37:54.950:WARN:Log:changed getSelectedRecord
                    20:37:54.971:WARN:Log:(TypeError): c.getSelectedRecord is not a function
                     fileName: http://localhost:8888/com.digitalage.ssb.MainSSB/0206CF919B62311A37C65A28E352302C.cache.html
                     lineNumber: 6721
                     stack: Awi([object Object])
                    @http://localhost:8888/com.digitalage.ssb.MainSSB/0206CF919B62311A37C65A28E352302C.cache.html:6721
                    wpc([object Object])
                    @http://localhost:8888/com.digitalage.ssb.MainSSB/0206CF919B62311A37C65A28E352302C.cache.html:510
                    Bxi([object Object])
                    @http://localhost:8888/com.digitalage.ssb.MainSSB/0206CF919B62311A37C65A28E352302C.cache.html:6738
                    o6f([object Object],[object Object],false)
                    @http://localhost:8888/com.digitalage.ssb.MainSSB/0206CF919B62311A37C65A28E352302C.cache.html:4610
                    z6f([object Object],[object Object])
                    @http://localhost:8888/com.digitalage.ssb.MainSSB/0206CF919B62311A37C65A28E352302C.cache.html:4601
                    Dqh([object Object])
                    @http://localhost:8888/com.digitalage.ssb.MainSSB/0206CF919B62311A37C65A28E352302C.cache.html:247
                    ([object Object],[object Object],"HELP8")
                    @http://localhost:8888/com.digitalage.ssb.MainSSB/0206CF919B62311A37C65A28E352302C.cache.html:306
                    ("HELP8",(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0))
                    @http://localhost:8888/com.digitalage.ssb.MainSSB/sc/modules/ISC_Forms.js:1054
                    ("SelectItem","handleChanged","HELP8",(void 0),(void 0),(void 0))
                    @http://localhost:8888/com.digitalage.ssb.MainSSB/sc/modules/ISC_Core.js:246
                    ("HELP8")
                    @http://localhost:8888/com.digitalage.ssb.MainSSB/sc/modules/ISC_Grids.js:1361
                    ("HELP8")
                    @http://localhost:8888/com.digitalage.ssb.MainSSB/sc/modules/ISC_Forms.js:1053
                    ()
                    @http://localhost:8888/com.digitalage.ssb.MainSSB/sc/modules/ISC_Forms.js:1632
                    ("HELP8",true)
                    @http://localhost:8888/com.digitalage.ssb.MainSSB/sc/modules/ISC_Forms.js:1627
                    ("HELP8")
                    @http://localhost:8888/com.digitalage.ssb.MainSSB/sc/modules/ISC_Forms.js:1661
                    ([object Object])
                    @http://localhost:8888/com.digitalage.ssb.MainSSB/sc/modules/ISC_Forms.js:1508
                    ([object Object],[object Object],9,[object Object],0,"Aiuto","Aiuto")
                    @http://localhost:8888/com.digital
                    and Firebug status in attachment

                    TIA,
                    falco
                    Attached Files
                    Last edited by falco; 30 May 2009, 08:09.

                    Comment

                    Working...
                    X