Announcement

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

    Datasource without HTTP

    I'm trying to fill a ListGrid and my json comes from a string, so I can't use the DataSource setDataURL() function because I don't need to make an HTTP request--I already have the json in a string. It seems that a DataSource can't be passed json directly and has to go through an HTTP request instead. Is there a way around this? Basically, I'm trying to avoid creating individual ListGridRecords one by one and adding them to the ListGrid when I would rather pass the whole json to fill the grid at once.

    #2
    You want to use ListGrid.setData().

    Comment


      #3
      I guess that was what I was trying to avoid. To use setData() on a ListGrid, I would have to create individual ListGridRecords over and over, put them in an array, and then call setData(). Is that the only way? I'm worried about the speed of doing that with large datasets. I'm looking for an alternative where I can just pass the entire grid contents as a json string all at once rather than creating individual ListGridRecords for each row.

      I found something about calling setClientOnly(true) on a DataSource and then using test data from a json string which would work for me, but I don't see how to implement that exactly.

      Comment


        #4
        I haven't done this myself, but here is another post that seems like what you're trying to do.

        Comment


          #5
          Thanks, that looks exactly like something I was looking for. I'll try using Record.convertToRecordArray( JavaScriptObject ).

          Comment


            #6
            You might also like to take a look at this project:

            CRMdipity -> http://code.google.com/p/crmdipity/ and this blog -> http://www.uptick.com.au/blog

            Also, this post which discusses both Gilead and Dozer -> http://code.google.com/webtoolkit/articles/using_gwt_with_hibernate.html

            - Mark

            Comment

            Working...
            X