That is how I've resorted to for now as well (with the exception of
the file upload part of my form not working as mentioned at start of
this thread).

Your example is a good one and similar to my own. Using your example,
I want to be able to re-use the FormjDiv partial in other pages of the
site. It is hard to re-use FormjDiv when it is coupled to HoursjDiv on
the controller side (as a result of FormjDiv refreshing HoursjDiv).
Ideally, I would want to have FormjDiv trigger a Javascript function,
either a specific named one I provide, or have it always call a
generic function - eg. jDivLoadSuccess(target) that I can implement on
the client side to take action.

In the generic case, the jDiv, upon successful submission would call
jDivLoadSuccess(target) passing its own target_id. I could then use
this to determine what action just took place and what action to take
next. In your example, if this function was called as a result of
target_FormjDiv submitting, then I would call jDivLoad
("target_HoursjDiv", myURL, null) to force a load of HoursJDiv. I
could also then hide FormJDiv, refresh it, and any other actions I
wish to take.

Not being forced to couple jDiv behavior together on the server side,
opens up much better scenarios for customizing interaction between
jDiv's and re-use of those jDiv's.


On May 1, 3:59 pm, Wes James <[email protected]> wrote:
> Right now with my time tracker i have:
>
> FormjDiv
> HoursjDiv
> Last20itemsjDiv
>
> When I submit FormjDiv it goes away (the lower part of the jDiv), but it
> refreshes HoursjDiv on the callback.  At the end of the code for HoursjDiv i
> have it trigger FormjDiv to open it up again with a new form (like click the
> first top button) and also to refresh contents in Last20itemsjDiv.
>
> There's probably a better way to do this, but this works for now.
>
> -wj
>
> On Fri, May 1, 2009 at 4:52 PM, Ted G <[email protected]> wrote:
>
> > On a related note:
>
> > What is the best way to trigger a Javascript function upon a jDiv load
> > or form submit within a jDiv? For example:
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to