Thanks Mario. I understand what you mean, but what I meant was that, I
needed to use a JsonReader to attach the returned data to my form fields,
but this was not working out properly, so i wanted someone to help with some
sample code. However, I figured out the problem. I was'nt setting the
JsonReader's root property.

On Wed, Sep 10, 2008 at 3:23 AM, Mario Lim <[EMAIL PROTECTED]> wrote:

>
> I think there is a confusion here.  XmlReader is used in the example
> here to read the data and attach them to the fields in the form.
> Submitting the form is standard HTML form submit...  You need to have
> something in the server side that does this the standard way.  There
> is no XML / JSon involved here (unless you're doing GWT RPC but that
> is a diff. story all together).  The return of your form processing
> should return some specific value formatted on a specific way to let
> GWTExt know that the form is saved or not and if not, what is the
> error message to display!
>
> On Tue, Sep 9, 2008 at 7:22 AM, Kwame <[EMAIL PROTECTED]> wrote:
> >
> > The example in Showcase2 uses an XmlReader like so:
> > ...
> > #         //setup form data reader
> > #         RecordDef recordDef = new RecordDef(new FieldDef[]{
> > #                 new StringFieldDef("first", "name/first"),
> > #                 new StringFieldDef("last", "name/last"),
> > #                 new StringFieldDef("company"),
> > #                 new StringFieldDef("email"),
> > #                 new StringFieldDef("state"),
> > #                 new DateFieldDef("dob", "dob", "m/d/Y")});
> > #
> > #         final XmlReader reader = new XmlReader("contact",
> > recordDef);
> > #         reader.setSuccess("@success");
> > #
> > #         //setup error reader to process from submit response from
> > server
> > #         RecordDef errorRecordDef = new RecordDef(new FieldDef[]{
> > #                 new StringFieldDef("id"),
> > #                 new StringFieldDef("msg")
> > #         });
> > #
> > #         XmlReader errorReader = new XmlReader("field",
> > errorRecordDef);
> > #         errorReader.setSuccess("@success");
> > .......
> >
> > #         formPanel.setReader(reader);
> > #         formPanel.setErrorReader(errorReader);
> >
> > ......
> >
> > #         final Button submitBtn = new Button("Submit", new
> > ButtonListenerAdapter() {
> > #             public void onClick(Button button, EventObject e) {
> > #                 formPanel.getForm().submit("data/xml-errors.xml",
> > null, Connection.GET,
> > #                                             "Saving Data...",
> > false);
> > #             }
> > #         });
> >
> > ........
> >
> > For JsonReader i changed to:
> >                        final JsonReader reader = new
> JsonReader("contact", recordDef);
> >                        reader.setSuccessProperty("success");
> >
> >
> > The API says Form uses JsonReader by default. However, when I try to
> > do the exact same thing as above using a JsonReader, the form does not
> > submit; it doesn't even give an error message!
> >
> > Does anyone kindly have a simple sample form submission using
> > JsonReader?
> >
> > Thanks
> >
> > >
> >
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to