BUMP.

I've wrote a script that makes smooth constant AJAX editing on client side.
http://pastebin.com/jamvUn7i
<http://tapestry.1045711.n5.nabble.com/file/n5718480/Untitled.png> 

I could also share the java code, if needed.
It is for my commercial app, where user have clients of its own, and he need
comments for them.
Tapestry renders the page and places special data attributes (id, timestamp)
on each textarea element. And also a value of textarea.
Then JS code builds data model of its own, on the client side. It
initializes a company of "Greg" guys -- underlying objects that store
comment objects (text, id, timestamp). 
Then "Alisa" objects are initialized, each Alisa is responsible for
corresponding textarea. It has link on wrapped JQuery object, and some
special getters and setters that work with field attributes.
Each Alisa is pushed to corresponding Greg as a listener.

When user presses the key, jQuery catches the event and sends updates tooooo
... Greg.
Then Greg checks data freshness and publishes the update to all of his
listeners.
In my code each Greg has two listeners:
Alisa -- unique object for textfield. When Alisa receives an update -- it
also checks it for freshness, so data won't be multiplied.
Daemon -- shared object that schedules the update to be send on server.
Alisa also does blink of eternal green glow, when update is sent.
Daemon also is the polling service, and when update arrives from server he
sends it tooooo ... Greg.


Reason, the:
1) When one property of the model is displayed in multiple field, or models
-- it will be updated instantly, no need for server fetch. Also, other
interface could also use that data, I think Asana does that.
2) More structured than css selectors manipulation, which means more
scalable.
3) Training in building client models, JS and so. I still don't now
prototyping technique.

I feel that data transition could be not optimal, also I still don't have a
clear picture, about the way, that I will use to get html from Tapestry in
future.
Also, I don't know nothing about Tapestry JS part.

And I love critics.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/SinglePage-app-design-thoughts-tp5718264p5718480.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to