actually it is cleaner/better to pass the model to the link directly, so
item.add(new IndicatingAjaxFallbackLink("link", item.getModel()) {
public void onClick(AjaxRequestTarget target) {
Object o=getModelObject();
}
}
-igor
On 9/6/07, Kent Tong <[EMAIL PROTECTED]> wrote:
>
>
>
>
> pokkie wrote:
> >
> > My question is, how do I use this information to get the selected entity
> > which represents a row in my listView?
> >
>
> Try:
>
> public class Test extends WebPage {
>
> public Test() {
> List<String> list = Arrays.asList(new String[] { "a", "b",
> "c" });
> ListView eachItem = new ListView("eachItem", list) {
> @Override
> protected void populateItem(ListItem item) {
> item.add(new
> IndicatingAjaxFallbackLink("link") {
> @Override
> public void
> onClick(AjaxRequestTarget target) {
>
>
> handleClick(getParent().getModelObjectAsString());
> }
>
> });
> }
> };
> add(eachItem);
> }
>
> private void handleClick(String clickedItem) {
> System.out.println(clickedItem);
> }
> }
> --
> View this message in context:
> http://www.nabble.com/AjaxFallbackLink-inside-ListView-tf4389622.html#a12520727
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>