Announcement

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

    related to DynamicDSGenerator and JAXB

    Hi,

    Currently I am in a process of evaluating smart-gwt EE.
    (using version 2.5 and chrome as a browser)

    I have a class which is annotated with Jaxb stuff.
    So using jaxb marshaller I am creating a Xml-Document and want to set this as DataSource on ListGrid. But getting following exception after DataSource.fromXml(xmldocument) is executed.

    I have registered my DS generator in init of a Servlet which extends RemoteServiceServlet

    BookStoreDS bookDsGenerator = new BookStoreDS();
    DataSource.addDynamicDSGenerator(bookDsGenerator);

    Can you please let me know how to get around with html escaping for such things?
    Is there alternate design I can use? (no ds.xml approach)
    So that all column names and data are added dynamically.
    This makes my UI future proof, in case more columns gets added.

    Thanks

    --------------------------------------------
    log and exception details.
    --------------------------------------------

    === 2011-09-28 12:06:39,538 [l0-0] INFO PoolManager - SmartClient pooling disabled for 'bookstore_table' objects
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ns2:bookStore xmlns:ns2="com.sample.jaxb.model">
    <location>Frankfurt Airport</location>
    <name>Fraport Bookstore</name>
    </ns2:bookStore>
    === 2011-09-28 12:06:41,613 [l0-0] DEBUG XML - Parsed XML from (in memory stream): 2ms
    === 2011-09-28 12:06:41,623 [l0-0] DEBUG XML - Parsed XML from /home/test/workspace/web/jaxb/war/jaxb/sc/system/schema/builtinTypes.xml: 4ms
    === 2011-09-28 12:06:41,661 [l0-0] WARN DataSource - dsConfig with no ID: {
    ns2:"com.sample.jaxb.model",
    location:"Frankfurt Airport",
    name:"Fraport Bookstore"
    }
    Uncaught JavaScript exception [Uncaught SyntaxError: Unexpected identifier] in http://127.0.0.1:8888/jaxb/sc/modules/ISC_Core.js, line 324

    --------------------------------------------------------------
    client invocation
    ---------------------------------------------------------------
    public class BookTableView extends VLayout {
    public BookTableView() {
    DataSource.load("bookstore_table", new Function() {

    @Override
    public void execute() {
    DataSource dataSource = DataSource.get("bookstore_table");

    ListGrid boundGrid = new ListGrid();
    boundGrid.setID("SimpleType");
    boundGrid.setDataSource(dataSource);
    boundGrid.setCanEdit(true);
    boundGrid.setWidth100();
    boundGrid.setHeight(300);

    addMember(boundGrid); //add to vlayout
    } } }
    Last edited by abhijit.dhariya; 27 Sep 2011, 23:44.

    #2
    DataSource.fromXML takes the same XML that should appear in a .ds.xml file.

    Presumably you are trying to supply data, not a DataSource definition. If so, don't serialize to XML, just return the beans directly. Start by reading the QuickStart, Server Framework chapter.

    Comment


      #3
      Thanks got it working !

      Comment

      Working...
      X