Announcement

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

    GwtRpcDataSource: WARN:ResultSet:isc_ResultSet_1 (created by:.):get: invalid index -1

    Hello,

    after updating to SmartGWT 2.1 I received the following error on an empty ListGrid:
    RDQ7:WARN:ResultSet:isc_ResultSet_1 (created by: isc_OID_39):get: invalid index -1

    As datasource I used the GwtRpcDataSource Version 1.0.

    The fetch code looks like:
    Code:
    		@Override
    		protected void executeFetch(final String requestId,
    				final DSRequest request, final DSResponse response) {
    			
    			AdministratorService.Util.getInstance().getModerators(customer.getIdCustomer(),	new AsyncCallback<List<User>>() {
    
    						public void onFailure(Throwable caught) {
    							response.setStatus(RPCResponse.STATUS_FAILURE);
    							processResponse(requestId, response);
    						}
    
    						public void onSuccess(List<User> result) {
    							//damit wir nicht immer neu laden müssen
    							users = result;
    							// Calculating size of return list
    							int size = result.size();
    							
    							ListGridRecord[] list = new ListGridRecord[size];
    							for (int i = 0; i < result.size(); i++) {
    								ListGridRecord record = new ListGridRecord();
    								record.setAttribute("name", result.get(i).getName());
    								record.setAttribute("active", result.get(i).isActive());
    								list[i] = record;
    							}
    						
    							response.setData(list);
    							// IMPORTANT: for paging to work we have to specify
    							// size of full result set
    							response.setTotalRows(result.size());
    							processResponse(requestId, response);
    							
    						}
    					});
    		}
    Does anyone have an idea?
    Thanks

    #2
    Hi,

    i am also getting the same error/warning. Is it to be ignored? Or how it is to be fixed?

    Thanks

    Comment


      #3
      Same Error

      I'm also getting this, any fixes?

      Comment


        #4
        Same case at my place.
        I thnik it has some connection with
        processResponse(requestId, response); and
        ListGrid.setFields() method.

        No solution for that yet.

        Comment


          #5
          same

          I get the same warning. Very ugly :-(

          Comment


            #6
            get the same error. i used the rpc datasource in a comboboxitem. no items were shown after reply from the server, but the record array is filled. here is my code. can somebody help me please.

            Code:
            final ComboBoxItem productChooser = new ComboBoxItem();
            final ProductDataSource productDataSource = new ProductDataSource();
            productChooser.setOptionDataSource(productDataSource);
            productChooser.setFetchDelay(500);
            productChooser.setValueField("productNr");
            productChooser.setDisplayField("productDescription");
            productChooser.addChangedHandler(new ChangedHandler() {
            
            	@Override
            	public void onChanged(final ChangedEvent event) {
            		if (event.getValue() != null
            				&& event.getValue().toString().length() > 0) {
            			Criteria criteria = new Criteria();
            			criteria.setAttribute("companyId", Fakturator.instance
            					.getCompanyId());
            			criteria.setAttribute("text", event.getValue().toString());
            			productDataSource.fetchData(criteria, new DSCallback() {
            					@Override
            				public void execute(DSResponse response,
            						Object rawData, DSRequest request) {
            					Record[] data = response.getData();
            					for (Record record : data) {
            						productDataSource.addData(record);
            					}
            				}
            			});
            		}
            	}
            });
            positionProductNr.setEditorType(productChooser);
            and here my datasource code

            Code:
            public class ProductDataSource extends GwtRpcDataSource<Product> {
            
            	DataSourceIntegerField productId = new DataSourceIntegerField("id");
            	DataSourceTextField productNrField = new DataSourceTextField("productNr");
            	DataSourceTextField productDescriptionField = new DataSourceTextField(
            			"productDesciption");
            
            	/**
            	 * 
            	 */
            	public ProductDataSource() {
            
            		productId.setPrimaryKey(true);
            		setFields(productId, productNrField, productDescriptionField);
            	}
            
            	/**
            	 * {@inheriteDoc}
            	 */
            	@Override
            	protected void executeAdd(String requestId, DSRequest request,
            			DSResponse response) {
            
            	}
            
            	/**
            	 * {@inheriteDoc}
            	 */
            	@Override
            	protected void executeFetch(final String requestId, DSRequest request,
            			final DSResponse response) {
            		ProductServiceAsync service = GWT.create(ProductService.class);
            		Integer companyId = request.getCriteria()
            				.getAttributeAsInt("companyId");
            		String text = request.getCriteria().getAttributeAsString("text");
            		service.findProductByDescription(companyId, text,
            				new AsyncCallback<FetchResult<Product>>() {
            					public void onFailure(Throwable caught) {
            						response.setStatus(RPCResponse.STATUS_FAILURE);
            						processResponse(requestId, response);
            					}
            
            					public void onSuccess(FetchResult<Product> result) {
            						ProductRecord[] list = new ProductRecord[result
            								.getFetchedList().size()];
            						for (int i = 0; i < list.length; i++) {
            							ProductRecord record = new ProductRecord();
            							copyValues(result.getFetchedList().get(i), record);
            							list[i] = record;
            						}
            						response.setData(list);
            						response.setStartRow(result.getStartRow());
            						response.setEndRow(result.getEndRow());
            						response.setTotalRows(result.getTotalRows());
            						processResponse(requestId, response);
            					}
            				});
            	}
            
            	/**
            	 * {@inheriteDoc}
            	 */
            	@Override
            	protected void executeRemove(String requestId, DSRequest request,
            			DSResponse response) {
            
            	}
            
            	/**
            	 * {@inheriteDoc}
            	 */
            	@Override
            	protected void executeUpdate(String requestId, DSRequest request,
            			DSResponse response) {
            	}
            
            	private static void copyValues(Product from, ProductRecord to) {
            		to.setProductId(from.getId());
            		to.setProductNr(from.getProductNr());
            		to.setProductDescription(from.getProductDescription());
            	}
            
            	/**
            	 * {@inheriteDoc}
            	 */
            	@Override
            	protected Object getValueOf(Product from, String fieldName) {
            		if (productId.getName().equals(fieldName))
            			return from.getId();
            		else if (productNrField.getName().equals(fieldName))
            			return from.getProductNr();
            		else if (productDescriptionField.getName().equals(fieldName))
            			return from.getProductDescription();
            
            		return null;
            	}
            }

            Comment

            Working...
            X