inMethod DataGrid initial selection

2009-10-02 Thread Swanthe Lindgren
Does anybody know how to get a row initially selected when the grid is 
first drawn?


//Swanthe


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: inMethod DataGrid initial selection

2009-10-02 Thread Martin Grigorov
grid.selectItem(rowModel);

El vie, 02-10-2009 a las 11:25 +0200, Swanthe Lindgren escribió:
 Does anybody know how to get a row initially selected when the grid is 
 first drawn?
 
 //Swanthe
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: inMethod DataGrid initial selection

2009-10-02 Thread Swanthe Lindgren
Yes, I got that part right, thank you. But somehow the item is not 
hi-lighted in my grid.
When the grid instance is constructed and added to the page, the data to 
be shown in the grid has not yet been loaded. I know that the row i want 
selected is going to be there once the data is loaded and the grid is 
displayed, so I tried to create a Model containing the selected object 
and setting it on the grid with DataGrid.selectItem(), and obviously it 
partially works since other components that are depending on the grid 
for model data is displaying the item correct information from the 
preselected item.

But still, the row in the displayed grid remains unselected.

So far I have configured my grid with
datagrid.setRowsPerPage(10);
datagrid.setClickRowToSelect(true);
datagrid.setClickRowToDeselect(false);
datagrid.setAllowSelectMultiple(false);
datagrid.selectItem(preselectedModel, true);


Any other suggestions?

Martin Grigorov wrote:

grid.selectItem(rowModel);

El vie, 02-10-2009 a las 11:25 +0200, Swanthe Lindgren escribió:
  
Does anybody know how to get a row initially selected when the grid is 
first drawn?


//Swanthe


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org






-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


  




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: inMethod DataGrid initial selection

2009-10-02 Thread Matej Knopp
Make sure that the equals method on your model(s) is properly
implemented. Also check equals on your entities.

-Matej

On Fri, Oct 2, 2009 at 1:37 PM, Swanthe Lindgren
swanthe.lindg...@megasol.se wrote:
 Yes, I got that part right, thank you. But somehow the item is not
 hi-lighted in my grid.
 When the grid instance is constructed and added to the page, the data to be
 shown in the grid has not yet been loaded. I know that the row i want
 selected is going to be there once the data is loaded and the grid is
 displayed, so I tried to create a Model containing the selected object and
 setting it on the grid with DataGrid.selectItem(), and obviously it
 partially works since other components that are depending on the grid for
 model data is displaying the item correct information from the preselected
 item.
 But still, the row in the displayed grid remains unselected.

 So far I have configured my grid with
 datagrid.setRowsPerPage(10);
 datagrid.setClickRowToSelect(true);
 datagrid.setClickRowToDeselect(false);
 datagrid.setAllowSelectMultiple(false);
 datagrid.selectItem(preselectedModel, true);


 Any other suggestions?

 Martin Grigorov wrote:

 grid.selectItem(rowModel);

 El vie, 02-10-2009 a las 11:25 +0200, Swanthe Lindgren escribió:


 Does anybody know how to get a row initially selected when the grid is
 first drawn?

 //Swanthe


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org






 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org