Try adding the behavior to the ListItem or the Label in the ListItem
Regards
Dipu
On Jan 14, 2008 12:34 PM, tsuresh <[EMAIL PROTECTED]> wrote:
>
> Hello , I want to update panel from lists. I have the list of users. When
> I
> click on the user I should get the user details on the UserDetailPanel. I
> want to do this using ajax and to display userdetail side by user list. I
> tried like this. But this is no way near I desired.
>
> ListView userList = new ListView("rows", userList) {
>
> protected void populateItem(ListItem item) {
> User user = User item.getModelObject();
> item.add(new Label("name", user.getName()));
> }
> };
>
> UserDetailPanel udp = new UserDetailPanel("panel","");
> final WebMarkupContainer wmc = new WebMarkupContainer("container");
> wmc.setOutputMarkupId(true);
> wmc.add(userList); //Since I want to update panel,
> shouldn't it be
> udp instead of userList?.
> AjaxEventBehavior behavior = new AjaxEventBehavior("onclick") {
>
> protected void onEvent(AjaxRequestTarget target) {
> User userSelected= (User ) getModelObject(); //I am
> getting null over here , I am trying to get selected
> //user here
> String selectedCat = userSelected.getName();
> target.addComponent(wmc);
> //how to update panel and get selected user here?
> }
> };
> wmc.add(behavior); //shouldn't it be userList.add(behavior);?
> There
> was onclick response when i did
> //wmc.add(behavior) but not when
> userList.add(behavior).
> add(udp);
> add(wmc);
>
> }
> }
>
> Please suggest.
> Thanks.
> --
> View this message in context:
> http://www.nabble.com/Update-panel-from-lists-tp14800898p14800898.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>