I tried doing this using the onclick event of the list item but there were a couple of problems. The biggest problem is that there may be hundreds of items in the list and inserting an ajax call in each item increases the page size too much for a mobile app. Another problem is that the id of the "detail page" component is modified by Wicket when I add ajax behaviors to it so the href in the item link is incorrect. I figured out how to handle this by changing the href using getMarkupId() but that kind of maintenance nightmare hacking turned me off to the whole approach. Finally I couldn't figure out how to get it to go to the detail page after I updated it - it just went back to the home page.

I tried adding an AjaxEventBehavior to the target div but the server-side event handler is never called. I don't understand how a custom event can be caught by the ajax engine unless there is js to tell it to do so and I don't see that Wicket has added any js in the page source to do that. If I knew how to tell the ajax engine to look for the custom javascript event then that approach would probably work.

On 5/4/2011 6:35 PM, Igor Vaynberg wrote:
can you not do it the other way around? have the link that goes to
detail be a wicket ajax link which then repaints the content div and
tells jquery that it did so?

otherwise what you can do is add an ajaxeventbehavior for that even to
the content div or whatever div receives it, or wire it in directly to
window, and repaint the content div inside the behavior's handler.

-igor


On Wed, May 4, 2011 at 3:27 PM, Scott Reed<sr...@avacoda.com>  wrote:
I want to update the models for the component's children and refresh it.

This app has a list on the "home page". Selecting one of the list items
causes a transition to the "detail page". During that transition the
pagebeforeshow event fires and then the page is displayed. When the
pagebeforeshow event fires, I want to update the page content elements with
details of the selected item. (As you may know, in jQuery Mobile these
"pages" are divs with data-roll="page".)

On 5/4/2011 6:13 PM, Igor Vaynberg wrote:
can you explain a bit more of what you want to happen when this
javascript event is fired?

-igor

On Wed, May 4, 2011 at 3:05 PM, Scott Reed<sr...@avacoda.com>    wrote:
Certain jQuery Mobile components can trigger a custom javascript event,
"pagebeforeshow", which I want to handle on the server. I am new to this
list and to Wicket and have not been able to find any documentation or
examples that show how this could be done.|I would appreciate any help in
figuring this out.
  Thanks,
    Scott
|

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to