[Dojo-interest] my way of running scripts with dojo.io.bind
Jon Sykes
jon.sykes at media-hive.com
Sat Apr 8 12:10:53 MDT 2006
Off the top of my head, if you're constrained to io because of the
posted variables, I'd be looking at using JSON as the return system
in io bind. Then set it up so that whatever data you're loading back
comes back in the form of a JS function that also initializes any
behaviors that might be needed to be applied to any elements.
In reality, if you're working within an environment you can get your
arms nicely around - phpBB being an example - you could just setup a
sort of pseudo API for your dojo application. So every call to a
specific piece of data on the server knows what format that data
should be returned, what will be done to it, and what behaviors need
to be applied once it's loaded.
Set that all up using things like topics and it could be quiet
manageable.
Jon Sykes
On Apr 8, 2006, at 1:39 PM, jbowman wrote:
> I'm using dojo.io.bind to pass requests using post. The initial
> page load is a contentpane using seturl and execute scripts.
>
> Basically I'm creating a new user profile system for phpBB2. The
> single page I am working on now includes
>
> - user photo section which includes buttons to add and remove
> friend status, ignore status, and a button to intiate sending a
> private message. My php backend determines which buttons are
> available based on cookie data for this section, and all the others.
>
> - user "journal" section. This section pulls the latest journal
> entry and displays it. This display also includes buttons to add a
> new journal entry, edit the current entry, or delete the current
> journal entry. This currently is the only area I've implemented the
> dojo editor, but I'll be moving to using it for most user content
> submissions. All journal functionality is handled with dojo so that
> a full page refresh is never needed.
>
> - a comments section, where other users can leave comments to the
> user. The last 10 are displayed, and right now this is section I am
> working on. On a new submission just this section is refreshed to
> show the newest 10 comments. Depending on user level other buttons
> are available, including edit and delete in each comment.
>
> An example of how one section of the page works would be the new
> comment button.
>
> The original contentpane loads, which calls a php page that
> determines the current viewer information by cookies. The original
> page also accepts 1 get request, user_id, so people can view other
> users, otherwise it defaults to their own page (unless they are not
> logged in, then it just shows a random user).
>
> When they click the new comment button, dojo.io.bind i called,
> passing on some information via post to change the div the comment
> button was in, to a div that includes a textarea and a button. When
> that button is clicked, once again dojo.io.bind is used to pass the
> content of that textarea, plus other information, using post back
> to the server, which parses it, updates the database with the new
> comment, and then the entire comment area is updated to show the
> new comment as the first of a list of 10, and the new comment
> button is restored.
> ---------------------------------------------------------------------
> Posted via Jive Forums
> http://forums.opensymphony.com/thread.jspa?
> threadID=25018&messageID=49127#49127
>
> _______________________________________________
> Dojo FAQ: http://dojo.jot.com/FAQ
> Dojo-interest at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
More information about the Dojo-interest
mailing list