Announcement

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

    Fill datasource from local XML

    Hi!

    I'm using GWT RPC to retrieve a XML from server, this XML is the datasource data file.

    How to fill the datasource with this XML?

    I have something like:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <countries>
    	<country>
    		<idCountry>1</idCountry>
    		<code>US</code>
    		<name>United States</name>
    	</country>
    	...
    	<country>
    		<idCountry>2</idCountry>
    		<code>BR</code>
    		<name>Brasil</name>
    	</country>
    </countries>
    It's into a String variable, how to pass it to DataSource?

    I found how to do it by DataSource.setDataURL(dataURL), but I already have the XML in the client.

    Thanks in advance!

    #2
    This usage doesn't make much sense - either deliver XML directly over HTTP using RestDataSource, or use GWT-RPC to deliver Java Objects (or use SmartGWT Pro or Enterprise, simpler than both).

    Comment


      #3
      Hi, me again.... :-P

      I'm using XMLTools.toJS to convert my XML into a JavaScriptObject.

      How is the best way to convert the JavaScriptObject into Records?

      Regards.

      Comment


        #4
        From the Record class :

        Code:
        public static Record[] convertToRecordArray(JavaScriptObject nativeArray)
        Sanjiv

        Comment

        Working...
        X