Getting the selected row in a grid
Hi all,
I have the following code for when the user selects a row in a grid:
"Local.selectedRow = ProcessContext.UserInput[0];"
I want it to return the row id of the item selected. Any tips on how to achieve this in v9 I thought this worked until I traced it with the debugger from my server script. It comes back zero everytime.
Thanks
Comments
-
Bump
0 -
I am not aware of a way to get the selected row of a grid on the server-side. ProcessContext.UserInput[0] will return the column value for the selected row and column (with the index (0 in your case) being based on the variable ordering in the Business Object that is being used in the grid.
I have only ever gotten the selected row number using client-side scripting, using a line like this (JScript):
var rowNum = eworkGetCurrentRow("GridFieldName");
0 -
here is a server side sample for code activity in "when user selects row" :
this.VorgangData1.ci_ID = this.Current.Fields.Grid3.SelectedRow["id"].ToString();
But we have found, that this solution has problems with paging in grids. If paging is "none" then everything works fine. If paging is enabled and we are going to the next page on the grid, then we got this message: "The given key was not present in the dictionary" ??! Only if you select a row before changing to the next page, it works fine ;-)
As a workaround the previous named solution works well.
this.VorgangData1.ci_ID = this.ProcessContext.UserInput[0].ToString();
But be aware that the index means the column of the business object - not the grid!
Thilo
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 159 General Questions
- 149 Thrust Services
- 57 Developer Hackathon
- 37 Thrust Studio
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 33 eDOCS
- 190 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 10 XM Fax
- Follow Categories