Re: getting child items of a ListView ListItem

2009-07-13 Thread Steve Swinsburg
Ok thats working nicely, the ModalWindow callback is inside the onClick of the Link in the Item and using one instance of a MW per list instead of one per item. Thanks for your help Martin :) Regards. On 12 Jul 2009, at 18:45, Martin Makundi wrote: BTW::: SHOW AFTER initializing callback

Re: getting child items of a ListView ListItem

2009-07-12 Thread Martin Makundi
BTW::: SHOW AFTER initializing callback. ** Martin 2009/7/12 Martin Makundi : > Yes. Why make it more complex :)? > > ** > Martin > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: u

Re: getting child items of a ListView ListItem

2009-07-12 Thread Martin Makundi
Yes. Why make it more complex :)? ** Martin 2009/7/12 Steve Swinsburg : > Ah so you attach the callback to the modal in the Link onClick, not in the > item itself? > > pseudocode: > > init modalwindow(); > > listview { >        populate item { >                link { >                        onCl

Re: getting child items of a ListView ListItem

2009-07-12 Thread Steve Swinsburg
Ah so you attach the callback to the modal in the Link onClick, not in the item itself? pseudocode: init modalwindow(); listview { populate item { link { onClick { get item set cont

Re: getting child items of a ListView ListItem

2009-07-11 Thread Martin Makundi
> Ok, except remember this is in a ListView so for each ListItem that I set > the callback for, the single instance of the modal window is being updated > to the latest callback. So when it fires, it will operate on the last item > in the list. No. The callback is issued when you click the button.

Re: getting child items of a ListView ListItem

2009-07-11 Thread Steve Swinsburg
Ok, except remember this is in a ListView so for each ListItem that I set the callback for, the single instance of the modal window is being updated to the latest callback. So when it fires, it will operate on the last item in the list. ie with your method - create a modal window for the en

Re: getting child items of a ListView ListItem

2009-07-11 Thread Martin Makundi
> So you setup a callback when you set the content on the modalWindow? That > could work nicely as well. Yes: modalWindow.setTitle(xx); modalWindow.setContent(yy); final AjaxButton ajaxButton = this; modalWindow.setWindowClosedCallba

Re: getting child items of a ListView ListItem

2009-07-11 Thread Steve Swinsburg
So you setup a callback when you set the content on the modalWindow? That could work nicely as well. Here's the new structure for your perusal: some display stuff from the Item in here

Re: getting child items of a ListView ListItem

2009-07-11 Thread Martin Makundi
> Ok so I was doing that before but had an instance of a ModalWindow per > ListItem, and the associated callback for each. Because it was all inside, > it was self contained so I could do all the updating easily. But this mean > many MW and callbacks per page. Sounds wild.. > This also means the

Re: getting child items of a ListView ListItem

2009-07-11 Thread Steve Swinsburg
Ok so I was doing that before but had an instance of a ModalWindow per ListItem, and the associated callback for each. Because it was all inside, it was self contained so I could do all the updating easily. But this mean many MW and callbacks per page. What I have done now is moved the MW o

Re: getting child items of a ListView ListItem

2009-07-11 Thread Martin Makundi
> So I am using: > -in ListItem and the Link onClick, get the parent Item. Keep a reference to > this. Why don't you already add all the necessary children to the ajaxRequestTarget here where you have the references? ** Martin > > On 11 Jul 2009, at 11:36, Martin Makundi wrote: > >>> I've got on

Re: getting child items of a ListView ListItem

2009-07-11 Thread Steve Swinsburg
Yeah but I'm asking what is the best way to get a handle on a child component of a ListItem. I understand I can update multiple components or repaint the whole lot, but I have many ListItems in my ListView with the same child components in each, and I need to update one at a time, hence ne

Re: getting child items of a ListView ListItem

2009-07-11 Thread Martin Makundi
> I've got one Modal/handler per ListView so it needs to know what item it was > clicked from so i still need to get a handle on the component itself to > update it, even if it gets its text from that model yes? No. You can update multiple components with ajaxRequestTarget.addChildren or you can d

Re: getting child items of a ListView ListItem

2009-07-11 Thread Steve Swinsburg
I'm opening a ModalWindow from an AjaxLink inside the ListItem. When that closes, in the close handler I need to update a couple of text items in the ListItem then repaint them so they refresh. I've got one Modal/handler per ListView so it needs to know what item it was clicked from so i st

Re: getting child items of a ListView ListItem

2009-07-11 Thread Martin Makundi
It would be better design to make the span update itself using an abstract readnly model: new Label("automatic", new AbstractReadOnlyModel() { public String getObject() { return "whatever value you need" + getSession().getCurrentValueOrState(); } });. ** Martin 2009/7/11 Steve Swinsburg : > Ye

Re: getting child items of a ListView ListItem

2009-07-11 Thread Steve Swinsburg
Yeah that sounds like what I need. I need to update some text in a span thats inside my ListItem once I do some processing. Thanks, Steve On 11 Jul 2009, at 10:16, Martin Makundi wrote: ListView returns an iterator of ListItems Each ListItem is a component so you can just do listItem.g

Re: getting child items of a ListView ListItem

2009-07-11 Thread Martin Makundi
ListView returns an iterator of ListItems Each ListItem is a component so you can just do listItem.get("component_id"); Does this sound like what you were looking for? ** Martin 2009/7/11 Steve Swinsburg : > Hi all, > > I have a ListView and need to be able to get some child items of a > partic

getting child items of a ListView ListItem

2009-07-11 Thread Steve Swinsburg
Hi all, I have a ListView and need to be able to get some child items of a particular ListItem, ie some spans, so that I can update their Models. How can I target some markup elements inside the ListItem container (ie TR tag)? Thanks, Steve