Thanks Margie, that has set me off on the right direction. Like yourself I do not have much experience with javascript, but I guess this is a great time to learn! I will investigate both the admin javascript and jquery to see what the best option is. I will report back once I have something useful to say.
Thanks again, Tom On Aug 13, 8:26 pm, Margie <margierogin...@yahoo.com> wrote: > I have been able to mimic the admin behavior in my own app. I > started off with the admin js functions showAddAnotherPopup and > dismissAddAnotherPopup. Study these in the context of how they are > used in the admin app and they should get you going. The best method > for me was to use firebug and put breakpoints at the begninning of > showAddAnotherPopup and dismissAddAnotherPopup and then print the > variables in those functions. They basically encode the id of the > input that you need filled in in the window name of of the popup > window, and then when the popup is closed, then return an httpResponse > that calls dismissAddAnotherPopup() and that extracts the window name > of the popup, uses it to identify the id where to place the result, > and then fills in the input appropriately. > > It is also useful to put a pdb breakpoint into the admin code in the > response_add() function, ie: > > import pdb > pdb.set_trace() > > This will make your server drop into pdb right before sending back the > response that calls dismissAddAnother(). If you do all of this and > then click on an "add another" (green "+") in the admin you should be > able to trace the process they use. > > I thought it was all pretty slick myself. I don't have a ton of > javascript experience, so am not sure if this is the best way to do > things or not. There might be something simpler in jquery, please > post if you do identify something simpler! > > This is not really in the realm of "django", since django doesn't > really have much to do with the javascript side of things, but still, > I'd be interested to know how others in this django community are > creating popup windows that fill in information and then pass it back > to some "main" window. > > Margie > > On Aug 13, 9:40 am, Thomas Scrace <t.scr...@gmail.com> wrote: > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---