On 12/27/05, R.J. Lorimer <[EMAIL PROTECTED]> wrote: > Hello, > > I've been working with the Wicket 1.2 snapshot to try and integrate some > more complex DOJO Ajax code for my site. > > In short (to give you an idea of what I'm trying to accomplish), I have > a weblog with entries and comments. When the user clicks on 'View > Comments', I'd like to use DOJO to pull down the comment list xhtml, > create a DOM out of it, and then wipe it in using dojo fx. > > Here is the interesting part - my comment list already exists as a > Wicket Panel object - so the Wicket side of the equation is almost > modularized completely. Here is what I have done, and where I am getting > stuck - I'll append the source code for the various parts I'm discussing > below: > > I've created a BlogCommentAjaxHandler that effectively adds unique dojo > functions for each blog entry to the top of the page. One of the > behaviors of the dojo function is to callback to the server, asking for > the result of the AJAX (using AjaxHandler.getCallbackUrl()). The custom > AjaxHandler I wrote overrides 'respond()', and instead of using the > ResourceStreamRequestTarget, it uses a ComponentRequestTarget with a > component of my BlogCommentsPanel (the plot thickens!) >
ComponentRequestTarget re-renders components which have already been rendered during the full page render. We only recently fixed a bug to allow Panel children to be re-rendered as well. Because you are re-rendering a Panel that bug should not affect you, but because of the change I'd still suggest to use cvs head. > I've then registered the AjaxHandler on to the ListItem for my blog > entry, and associated it with a triggering component (a label to which > I've added an on-click). Because ListItems can always be re-created on the fly, they are removed by default for memory efficiency (and cluster bandwidth) reasons. Hence attaching the handler to a ListItem which than gets removed (and rebuild without your handler) might cause the exception. ListView.setOptimizedItemRemoval(true) avoids the list item removal. Sorry, but that is all that comes into my mind. In case you don't find a solution, send us the (stripped down) source code and we try to find the problem. Juergen ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_idv37&alloc_id865&op=click _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user