[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Selected Row Index  XML
Forum Index -> Development
Author Message
asingla

Active

Joined: 12/12/2009 15:13:10
Messages: 5
Offline

Hi,

I have created a fixGrid with one column being used to delete the entire row.

However, when I press the delete button on any row, I do not get the selected row Index.
Rather I get the complete object of the selected row.

Wouldnt it be convenient to return the selected row index as well as selected row object?

I have been using richfaces till date wherein I get both the selected row index and object.
If this feature is already present, please let me know.

Thanks,
Akash

Admin

Power User

Joined: 21/11/2007 11:36:10
Messages: 37
Offline

Hi,

please take a look into the demo workplace:

Grids and Trees => Grids and Trees ==> Simpe Grid (the very first grid example).

This exactly does what you want to do (at least that's what I believe).

In case the example does not respond to your question: please continue this discussion...

Regards! Björn

asingla

Active

Joined: 12/12/2009 15:13:10
Messages: 5
Offline

Hi,

I am already using this method to remove objects from the list.

However, my point was that if I need to store somewhere the index of the row that was being removed, I will have have to write extra line,

Code:
list.indexOf(obj)


I was thinking if according to the user requirement, either the row no. or the selected object be returned from the page. Currently, there is option for only selected object

Thanks
Akash
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5520
Offline

Hi,

yes, what you say is right + "by intention". Lists by default support sorting (with keeping the selection), so the index is quite unstable, that's the background. Same with adding items into the list.

...of course you may write the object index into your row object (the one extending from FIXGRIDListItem) in case you want to have a "ultra-quick" access to the index information, but then must keep track of the index yourself (in case of sorting, adding items in front of selection).

Regards, Björn

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team