Hi Nick,
Sorry, this got stuck in my out box - I meant to send it much sooner...
Replies below:
[EMAIL PROTECTED] wrote:
> Hi Max,
>
> I'm experimenting with Openlaszlo in conjunction with Rails and am currently
> grappling with how data synchronisation works - your reply to Luca has shed
> some light on this (I'd not seen the DB Connector spec before), but I wonder
> if you'd be kind enough to help me understand further?
>
> Prior to the updated Openlaszlo/Rails plugin I used the REST api to create
> the attached "address book" applet - the datasets at the top set up paths to
> the REST api controller and force the list of names to update ondata. It's
> not pretty, but it works - my short-term goal is to combine these into a
> single window and animate between them with states, but before I do, I'd like
> to tidy up the data side of things. In light of the new Openlaszlo Rails
> plugin I now have two questions:
>
> 1) How would I adapt what I've done to work with your datamanager.lzx class,
> and how does the modelcontroller relate to this?
Datamanager is used by the modelcontroller for making requests.
modelcontroller overrides the handle() method for dealing with
ondata/timeout/error conditions. The datamanager is useful when you
want to fire off any number of requests and get the data without having
to declare datasets ahead of time.
The modelcontroller is designed to handle all create, read, update and
delete operations. It's designed to automatically keep a single dataset
in sync with the server's data model. As records are updated or
created, the appropriate commands will be sent to the server. All you
should need to do is define a single dataset for all of your records:
<dataset name="addressData">
<records/>
</dataset>
And a model controller instance that points to this dataset:
<modelcontroller name="addressController"
maindataset="$once{addressData}" modelName="address">
<method event="oninit">
this.loadRange(0, 22);
</method>
</modelcontroller>
> 2) How do I take the XML success/error/timeout response and update the views
> based on this info?
All error handling is handled by the modelcontroller. You should be
able to bind to the main dataset (addressData) and as changes are made,
the server will automatically be updated.
> If you can help me shed any light on this I'd really appreciate it. Many
> heartfelt thanks for your excellent work on the plugin so far - Openlaszlo
> seems like an awesome framework with great potential.
I'm glad to see someone using it :). Feel free to ping me if you have
more questions!
--
Regards,
Max Carlson
OpenLaszlo.org
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user