Announcement

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

  • alius
    replied
    Hi,

    Originally posted by usrinivas
    Hi,

    We started using SmartGWT and I want to use ListGrid using RPC calls. Could you please post all the Test files? I can try the test application first before start working on ListGrid.
    You can download all files from smartgwt-extensions:
    http://code.google.com/p/smartgwt-extensions/source/browse/trunk/src/main/java/com/smartgwt/extensions/client/gwtrpcds

    Aleksandras.

    Leave a comment:


  • usrinivas
    replied
    Request to post all required files for ListGrid

    Hi,

    We started using SmartGWT and I want to use ListGrid using RPC calls. Could you please post all the Test files? I can try the test application first before start working on ListGrid.

    Leave a comment:


  • bitblaster
    replied
    Originally posted by alius
    Hi bitblaster,

    Try to use getAttributeAsObject and check in debugger type of the object.
    If type matches - just cast it into correct type.

    Aleksandras.
    Thank you alius, that worked!!!

    Leave a comment:


  • mnenchev
    replied
    Hi alius. Did you managed to do some complex filter?

    Leave a comment:


  • alius
    replied
    Hi bitblaster,

    Try to use getAttributeAsObject and check in debugger type of the object.
    If type matches - just cast it into correct type.

    Aleksandras.

    Leave a comment:


  • bitblaster
    replied
    Originally posted by mnenchev
    Try using firebug, it helps me alot with ajax and gwt requests and responses and js.
    I tried but i'm unable to debug javascript with Firebug. If i activate the Script section the application doesn't work correctly (and doesn't give me any feedback). As soon as i disable the Script section all works correctly (but i obviously cannot hit any "debugger;" breakpoint i putted in the code (i made some native functions to output custom code useful for debugging).

    Does someone know how i can overcome this problem?

    Leave a comment:


  • mnenchev
    replied
    Try using firebug, it helps me alot with ajax and gwt requests and responses and js.

    Leave a comment:


  • bitblaster
    replied
    @alius:
    i've problems if i make the grid editable. When i do some editings it throws me a javascript exception
    Code:
    Uncaught JavaScript exception [com.google.gwt.core.client.JavaScriptException: (TypeError): Proprietà o metodo non supportati dall'oggetto
     number: -2146827850
     description: Proprietà o metodo non supportati dall'oggetto
    	at com.smartgwt.client.util.JSOHelper.getAttributeAsDate(Native Method)
    	at com.smartgwt.client.core.DataClass.getAttributeAsDate(DataClass.java:166)
    	at it.infracom.prova.client.TestDataSource.copyValues(TestDataSource.java:186)
    	at it.infracom.prova.client.TestDataSource.executeUpdate(TestDataSource.java:136)
    	at it.infracom.jwolfgwt.client.GwtRpcDataSource.transformRequest(GwtRpcDataSource.java:107)] in http://localhost:8888/it.infracom.prova.Shell/hosted.html?it_infracom_prova_Shell, line 10
    where in italian the text "Proprietà o metodo non supportati dall'oggetto" means "Object field or method unsupported".

    it happens when it executes the method
    private static void copyValues(ListGridRecord from, TestRecord to)

    exactly when it tries to parse the date:
    Code:
    to.setDate(from.getAttributeAsDate("date"));
    I "sniffed" the call in the developer console, but it seems that the date is correctly set

    Code:
    15:48:59.202:TMR9:DEBUG:gridEdit:isc_OID_19:editRowForm created with values: {__ref: com.smartgwt.client.widgets.grid.ListGridRecord@e00095,
    id: 6,
    name: "Name 6",
    date: Mon Mar 30 15:40:08 CEST 2009,
    _selection_4: true}
    Any ideas?
    Thanks!
    Bit

    Leave a comment:


  • mnenchev
    replied
    filters

    Hi, all any success with adding filters to the life grid, that that are sent to the server?

    Leave a comment:


  • Isomorphic
    replied
    Various APIs on the ListGrid, such as getEditedRecord(), allow you to collect all the data for saving as a single RPC.

    Leave a comment:


  • alius
    replied
    Hi,
    It is not related with GWT-RPC. I've tested saveAllEdits() myself - it is ListGrid which is initiating inserts/updates and it is doing by row.
    I think you should ask this question SmartClient team.

    Aleksandras.

    Leave a comment:


  • jasonzhang2002
    replied
    Hi, guys
    With the GWT-RPC implementation, is there a way to send update data in batch?

    I set my grid setAutoSaveEdits(false) and save editing when a button is clicked by calling saveAllEdits(). However, the executeUpdate is stilled called with one modified record each time. I expect I can get an array of updated record, and send them to server once.

    thanks

    -jason

    Leave a comment:


  • Przemeq
    replied
    Maybe it's posiblle to add 1 more "dummy" parameter to the filter that will be always sent?

    Leave a comment:


  • bitblaster
    replied
    Originally posted by mnenchev
    So far so good. Every thing works, but now we are facing the filtering feature. I tried to do the following:
    for the grid
    DSRequest dsr = new DSRequest();
    dsr.setAttribute("criteria", listGrid.getCriteria());

    And in my datasource: Criteria criteria = (Criteria)request.getAttributeAsObject("criteria");
    But i am not sure if this issss gona work.
    Is somebody implemented server side filtering. I just need some way to send the filtered column name, filtered value, and filter type.
    Yes i'm facing that problem since yesterday. It is possible to obtain the filters from the DSRequest's "data" object, like this:


    Code:
    	JavaScriptObject dataobj = request.getData();
    	if(dataobj != null) {
    		String[] properties = JSOHelper.getProperties(dataobj);
    		for (String attr : properties) {
    			String val = JSOHelper.getAttribute(dataobj, attr);
    		}
    	}
    For example if you have filtered the field "id=5", you will have only one element in the properties array, "id". If you then call JSOHelper.getAttribute(dataobj, "id") this will return "5".


    The problem is that this is true only if you have ONE filter, if you have 2 filters, for example, the above code is no more valid, as you will have nested properties. For example suppose you filtered on "id=5" AND "name='pippo'".

    In this case the properties array will contain 2 elements:
    - operator: "and"
    - criteria: another array of 2 objects which are the operand of the "and" operator.
    You have so to detect such situations and apply the above code recursively.
    Further you have to create an object (serializable) which will contain this filter structure and that you will pass to the server in the RPC call.

    I'm writing this code and will post when i'm done.

    Leave a comment:


  • mnenchev
    replied
    So far so good. Every thing works, but now we are facing the filtering feature. I tried to do the following:
    for the grid
    DSRequest dsr = new DSRequest();
    dsr.setAttribute("criteria", listGrid.getCriteria());

    And in my datasource: Criteria criteria = (Criteria)request.getAttributeAsObject("criteria");
    But i am not sure if this issss gona work.
    Is somebody implemented server side filtering. I just need some way to send the filtered column name, filtered value, and filter type.

    By the way i tried the life grid with more than 4k records, and tested it. firebug says that this grid sends 2-3-4 requests on scrolling, and i was evil and scrolled alot i the number of requests has increased to 9.
    FYI: firefox supports 8 simultaneous and it managed them somehow but IE supports only 2. What happen then. And does this overkill the server?

    Leave a comment:

Working...
X