Hi, I am using the Ajax.Updater as the afterUpdateElement callback function for Ajax.Autocompleter. Users search for something, select it from a drop down, then Ajax.Updater makes a request to the server and retrieves the appropriate data for the chosen object. If the system provides an object id in the URL initially, the search page displays the appropriate data right away (without using either Ajax.Autocompleter and Ajax.Updater). The response page has an in place editor (Ajax.InPlaceEditor) for some of the fields which does not work if I use the Ajax.Updater to populate the page. However, it does work when the page is populated directly. I read something in Ajax.Updater''s docs about not being able to return JavaScript code in the server response, but I am not sure how to get around that limitation. TIA for any ideas/suggestions. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey Grigora, When you wish to enable features over dynamically-returned markup, you must do so *after* this markup has been injected into the DOM (ideally). So when you update/replace the contents of a DOM fragment with Ajax.Updater, whatever behavior you assigned first is bound to the *prior* DOM elements, not the *new* ones. Ideally, you would clean up the former behavior objects (in this case, you''d call dispose() on the former Ajax.InPlaceEditor); then at any rate, you''d follow your markup insertion with a script creating a new IPE on the fresh contents. This can be done with Ajax.Updater by enabling its evalScripts option, which defaults to false. Then your returned markup should contain a small inline script at the bottom of it, that would create the IPE over the proper element ID, with all due options. ''HTH -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey Christophe, Thanks very much for the response. It''s working perfectly. On Apr 23, 11:09 pm, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Hey Grigora, > > When you wish to enable features over dynamically-returned markup, you > must do so *after* this markup has been injected into the DOM (ideally). > So when you update/replace the contents of a DOM fragment with > Ajax.Updater, whatever behavior you assigned first is bound to the > *prior* DOM elements, not the *new* ones. > > Ideally, you would clean up the former behavior objects (in this case, > you''d call dispose() on the former Ajax.InPlaceEditor); then at any > rate, you''d follow your markup insertion with a script creating a new > IPE on the fresh contents. > > This can be done with Ajax.Updater by enabling its evalScripts option, > which defaults to false. Then your returned markup should contain a > small inline script at the bottom of it, that would create the IPE over > the proper element ID, with all due options. > > ''HTH > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---