> > I have an alert to verify that the data-w2p_remote is set correctly but > the XHR is still made to the default page. > Is there some sort of a trigger or a function that I can call that lets > the code in web2py.js know that the URL in the data-w2p_remote attribute > was changed? > That would resolve my problem!! >
No, that approach won't work, as the data-w2p_remote value is read only once when the parent page is first loaded. Also, if all you want to be able to do is set a custom id for the component div, there is no reason to construct it manually -- just use the "target" argument to load: LOAD(..., target='mycontent') As I suggested, you'll have to set up an event handler to monitor completed Ajax requests. You can detect Ajax requests related to the component because they will include a special request header called "web2py-component-element" whose value will match the id of the component div (i.e., the value set as the "target" argument to LOAD). When you detect such a request, grab its URL and set that as the URL to be reloaded every 10 seconds. You'll need to set up your own reloading code, as you will not be able to use the built-in reloading functionality (which can only reload the original data-w2p_remote URL). Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.