Re: how do I get the selected entity of a table

2011-02-16 Thread Hans Lesmeister 2
hrbaer wrote: ... protected void populateItem( ListItemEntity item ) { final Entity e = item.getModelObject(); item.add( new Label( text, e.getName() ) ); e not null? item.add( new Link( Details_Link ) {

Re: how do I get the selected entity of a table

2011-02-15 Thread Hans Lesmeister 2
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( ListItemEntity item ) { final Entity entity = item.getModelObject(); // cast not needed

Re: how do I get the selected entity of a table

2011-02-15 Thread Pedro Santos
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 hans.lesmeis...@lessy-software.de wrote: hrbaer wrote: I'm trying to get the entity of the choosen row. Can someone provide me how do achieve that? Thanks in

Re: how do I get the selected entity of a table

2011-02-15 Thread James Carman
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 pedros...@gmail.com 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

Re: how do I get the selected entity of a table

2011-02-15 Thread Hans Lesmeister 2
Hi, James Carman wrote: For safety, you probably want to get the entity from the item again, right? Why would that be safer? You mean in case the item's ModelObject has been replaced somewhere? Cheers Hans -- View this message in context:

Re: how do I get the selected entity of a table

2011-02-15 Thread James Carman
No, I mean in case the model is a LDM and they would be getting a fresh copy of the entity from the database, as opposed to a detached one. On Tue, Feb 15, 2011 at 10:47 AM, Hans Lesmeister 2 hans.lesmeis...@lessy-software.de wrote: Hi, James Carman wrote: For safety, you probably want to

Re: how do I get the selected entity of a table

2011-02-15 Thread Hans Lesmeister 2
James Carman wrote: No, I mean in case the model is a LDM and they would be getting a fresh copy of the entity from the database, as opposed to a detached one. Thanks James, that's a good hint - -- Regards, Hans http://cantaa.de Voetbal is heel erg simpel. Het moeilijkste aan