Announcement

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

  • mnenchev
    replied
    Excuse me, it's my fault. I used notepad to write the code. HasSmartGWTDataResource == SmartGWTDataConverter. This class just transforms data (model <=> smart gwt record). You may also need add other methods (for treenodes for example). It's up to you :).
    I updated the archive, every thing should be ok now.
    Last edited by mnenchev; 30 Sep 2009, 07:30.

    Leave a comment:


  • ynaik
    replied
    Originally posted by ynaik
    Hi Mnenchev,

    I am not very clear about the SmartGWTDataConverter java class,
    which contains interface HasSmartGWTDataResource , this public interface must be defined in its own class isn't it ? how can we name it as SmartGWTDataConverter .java, hope i am not sounding stupid :)

    When I rename SmartGWTDataConverter.java to HasSmartGWTDataResource , it cannot be resolved to Type
    (R extends HasSmartGWTDataConverter, cannot to be resolved Type)

    Hi Mnenchev,

    Please ignore above comments, I noticed i was just a class name spell error.

    Leave a comment:


  • ynaik
    replied
    Originally posted by ynaik
    Thanks a ton, I will surely upload the code in case i improve it.
    I don;t have access to download it now, will try this at home.
    Thanks a lot.

    Hi Mnenchev,

    I am not very clear about the SmartGWTDataConverter java class,
    which contains interface HasSmartGWTDataResource , this public interface must be defined in its own class isn't it ? how can we name it as SmartGWTDataConverter .java, hope i am not sounding stupid :)

    When I rename SmartGWTDataConverter.java to HasSmartGWTDataResource , it cannot be resolved to Type
    (R extends HasSmartGWTDataConverter, cannot to be resolved Type)
    Last edited by ynaik; 30 Sep 2009, 06:20.

    Leave a comment:


  • ynaik
    replied
    Originally posted by mnenchev
    Hi, ynaik. I attached you sample code (just .java files). Home it helps you. I didn't tested, but it should work. If you find any bugs, or errors let me know. Only executeAdd method is implemented, but the others are in the same manner. If you improve the code paste it here :).
    Download from here : http://rapidshare.com/files/28652421...ample.zip.html

    All you have to do is to implement SmartGWTDataConvertor for each dto you want to use and create ds for it like this:
    Code:
    final SmartGWTDataSource<TestDTO, SmartGWTDataConverter<TestDTO>, DataServiceAsync<TestDTO>> ds = 
    			new SmartGWTDataSource<TestDTO, SmartGWTDataConverter<TestDTO>, DataServiceAsync<TestDTO>>(new TestDataConverter(), ServiceUtils.getTestServiceAsync(), RecordType.GRID);
    Thanks a ton, I will surely upload the code in case i improve it.
    I don;t have access to download it now, will try this at home.
    Thanks a lot.

    Leave a comment:


  • mnenchev
    replied
    Originally posted by ynaik
    Thank you very much your prompt reply, I will really appreciate if you can upload your detailed generic functionality code.

    I will wait for your response.
    Hi, ynaik. I attached you sample code (just .java files). Home it helps you. I didn't tested, but it should work. If you find any bugs, or errors let me know. Only executeAdd method is implemented, but the others are in the same manner. If you improve the code paste it here :).
    Download from here : http://rapidshare.com/files/28695615...ample.zip.html

    All you have to do is to implement SmartGWTDataConvertor for each dto you want to use and create ds for it like this:
    Code:
    final SmartGWTDataSource<TestDTO, SmartGWTDataConverter<TestDTO>, DataServiceAsync<TestDTO>> ds = 
    			new SmartGWTDataSource<TestDTO, SmartGWTDataConverter<TestDTO>, DataServiceAsync<TestDTO>>(new TestDataConverter(), ServiceUtils.getTestServiceAsync(), RecordType.GRID);
    Last edited by mnenchev; 30 Sep 2009, 07:38.

    Leave a comment:


  • ynaik
    replied
    Originally posted by mnenchev
    Hi, as you can see i was asking the same question as you did, but no one answered. I used the sample snippet to implement this generic functionality. I think that DTObject model is just base class for all your dtos.

    public class DTObjectModel implements Serializable {

    }
    :-D

    If you want i may upload detailed code that uses the lanceweber's sample, but i did not test it.
    Thank you very much your prompt reply, I will really appreciate if you can upload your detailed generic functionality code.

    I will wait for your response.

    Leave a comment:


  • mnenchev
    replied
    Originally posted by ynaik
    Can you please upload DTObjectModel class?
    Hi, as you can see i was asking the same question as you did, but no one answered. I used the sample snippet to implement this generic functionality. I think that DTObject model is just base class for all your dtos.

    public class DTObjectModel implements Serializable {

    }
    :-D

    If you want i may upload detailed code that uses the lanceweber's sample, but i did not test it.
    Last edited by mnenchev; 29 Sep 2009, 00:53.

    Leave a comment:


  • ynaik
    replied
    Can you please upload DTObjectModel class?

    Originally posted by mnenchev
    Hi, could you give us, more detailed example? What is this DTObjectModel. Pleas provide some simple usage :).

    Can you please upload DTObjectModel class?

    Leave a comment:


  • jzaruba
    replied
    Could someone PLZ post an example of using DynamicForm together with GWTRPCDataSource?

    I'm very green on this, so I am only guessing I should be able to tell somehow the form to load a record/object from provided (GWTRPC)DataSource and populate (maybe not necessarilly create) its fields with the properties.

    This is the closest answer I've been able to find in the SmartGWT ShowCase, but this example does not use 'real' DataSource.

    Leave a comment:


  • levi
    replied
    Originally posted by BeezeR
    Hi, All.

    How can i set custom object to Criteria?

    For example:
    Code:
     
           		Criteria criteria=new Criteria();
           		criteria.addCriteria("customObject", new CustomObject());  
                    listGrid.fetchData(criteria);    
    
    public void executeFetch(final String requestId, final DSRequest request, final DSResponse response) {
    Object object = request.getCriteria().getAttributeAsObject("customObject"));
    }
    In execute fetch i get JavaScriptObject and not convert to my CustomObject. May be exists another methods of getting my ccriteria?

    I had the same problem. I found that it works by calling fetchData() directly on the datasource instead of on the listGrid. Also, it's only a problem in hosted mode.

    Leave a comment:


  • tholmes66
    replied
    Alius: Updated Code

    Alius: Is there any new sample code for TestAdvDataSource.
    I downloaded this zip file, and it seems to work great, but I have a couple of issues. So, I was looking for updated source code.

    There was the SmartGWT-Extensions at Google as created by Nicholas.Lotz, but there seems to be a bug in it.

    Any help would be much appreciated. I'm on a tight deadline now, and my last 4 messages here got no replies from anyone.

    Thanks for any help!
    Tom

    Leave a comment:


  • BeezeR
    replied
    Set custom object to Criteria

    Hi, All.

    How can i set custom object to Criteria?

    For example:
    Code:
     
           		Criteria criteria=new Criteria();
           		criteria.addCriteria("customObject", new CustomObject());  
                    listGrid.fetchData(criteria);    
    
    public void executeFetch(final String requestId, final DSRequest request, final DSResponse response) {
    Object object = request.getCriteria().getAttributeAsObject("customObject"));
    }
    In execute fetch i get JavaScriptObject and not convert to my CustomObject. May be exists another methods of getting my ccriteria?

    Leave a comment:


  • tpbout
    replied
    fetchData() working, fetchData(Criteria) does not

    Hi All


    I'm using one of the older generalized<T> versions of GWT-RPC datasource.

    Everything seems to work fine as long as i stick to fetchData().
    I can retrieve records, add records, edit them and the results are indeed updated in the database. Sofar so good.

    However, when i use fetchData(criteria), I either get all records or no records.
    I toyed with setFetchMode(), setUseClientFiltering, etc but to no avail, i either get everything or i get nothing.

    My criteria is as basic as it gets:
    Code:
         		Criteria criteria=new Criteria();
           		criteria.addCriteria("Name","test");  
                    projectList.fetchData(criteria);
    My database is very small, only 20 record or so.

    It is very well possible that i misunderstood some of the basics of either gwt-rpc or smartGWT, i'm not that experienced with either.

    So, what am i missing here? Can somebody please point me in the right direction?

    Leave a comment:


  • jzaruba
    replied
    Possible pitfalls

    I just wanted to post those in case anyone would make some of the (quite long row of) mistakes I did.
    Hopefully it saves some time to someone...

    When implementing FETCH in your DataSource you better avoid trying to generalize it to Collection<T>. Compiler won't complain but you are asking for HTTP 500. (I guess it has something to do with how is Collection type treated during the process of serialization.) List<T> works just fine.

    When implementing REMOVE (or any non read-only operation) do not forget to mark exactly one of your DataSourceFields as primaryKey.
    Without that your DSResponse.getData() will return empty array.
    Last edited by jzaruba; 19 Sep 2009, 14:41.

    Leave a comment:


  • mnenchev
    replied
    Originally posted by chetan.phanse
    Any response on this one?
    What do you mean? On update you do not need to fetch the data again just update the edited row. But if you execute insert operation you do need to return the primary key(the id) of the grid record and then insert the new ListGridRecord with initialized id. That is in case you know that only one user can view/modify the screen at a time.

    Leave a comment:

Working...
X