For safety, you probably want to get the entity from the item again, right?
On Tue, Feb 15, 2011 at 9:18 AM, Pedro Santos <[email protected]> wrote: > Hi Hans, the object pointed by entity variable is already the selected one. > > On Tue, Feb 15, 2011 at 12:11 PM, Hans Lesmeister 2 < > [email protected]> wrote: > >> >> >> hrbaer wrote: >> > >> > I'm trying to get the entity of the choosen row. >> > Can someone provide me how do achieve that? Thanks in advance! >> > >> >> >> protected void populateItem( ListItem<Entity> item ) { >> >> final Entity entity = item.getModelObject(); // >> cast not needed >> item.add( new Label( "text", e.getName() ) ); >> item.add( new Link( "Details_Link" ) { >> >> @Override public void onClick() { >> label.setVisible( true ); >> >> // how do I get the selected entity? >> // selectedEntity = ??? >> entity.doSomethingWithMe(); // >> Use it here >> } >> >> }); >> >> >> -- >> View this message in context: >> http://apache-wicket.1842946.n4.nabble.com/how-do-I-get-the-selected-entity-of-a-table-tp3306749p3306816.html >> Sent from the Users forum mailing list archive at Nabble.com. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > > > -- > Pedro Henrique Oliveira dos Santos > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
