Getting data from currently selected row in a grid
Hi, thanks in advance for your help.
I have a grid that is getting it's data from table business object. When the user selects a row, I would like to populate form fields on the same form (the grid displays only a subset of the fields available - this is like a summary/detail view). I have a function for when user selects row, and I do an assign values activity. My current code looks like:
Local.Form_Field1=BusinessObject.Field1
When the user selects a row, it takes the value from the 1st row and puts it in the form field. The problem is that the BusinessObject is always tied to the first row, if I select the second row, it still puts the first row data in the field. What is the expression to get the BusinessObject tied to the current row?
Thanks.
Comments
-
You have to use ProcessContext.UserInput.
0 -
I was just going to post an almost identical question. Thanx very much!!!
The designer manual explains "When user select row" with all of the following detail:
"Do this when the user selects a row"
That much I could have guessed!!!
0 -
When I try to assign a variable, Local.Var with the value, ProcessContext.UserInput, I get this error. And I still need to specify which column to use...
Non-invocable member 'Metastorm.Runtime.Core.ProcessContext.UserInput' cannot be used like a method.
The only thing that the designer manual says is:
"Returns the text entered by the user into the current field. (If the form field contains a collection of data, return it as
a list.) Note that UserInput variable can be accessed only from Expression Builder. (Expression Builder->Business
Object->ProcessContext)."
What about a grid? What about using it on the left side of an assignment?
0 -
Are you writing it in c#? Normally when I get that error it means I've put round brackets after a property, where they shouldn't be. I'm assuming you want a column number too, so maybe you do ProcessContext.UserInput[0] using square brackets round the column number.
0 -
RKushner wrote:
When I try to assign a variable, Local.Var with the value, ProcessContext.UserInput, I get this error. And I still need to specify which column to use...
Non-invocable member 'Metastorm.Runtime.Core.ProcessContext.UserInput' cannot be used like a method.
The only thing that the designer manual says is:
"Returns the text entered by the user into the current field. (If the form field contains a collection of data, return it as
a list.) Note that UserInput variable can be accessed only from Expression Builder. (Expression Builder->Business
Object->ProcessContext)."
What about a grid? What about using it on the left side of an assignment?
Square brakets not round ones: ProcessContext.UserInput[x] not the ProcessContext.UserInput(x) you may be using.
0 -
I know this is an old thread, but my issue is directly related to this. I have a form with multiple grids on it. The first grid is a parent grid to the second. When I select a row in the parent grid, I need to display rows in the child grid based on a column from the parent grid. I currently have a parameter in the BO of the child grid set to ProcessContext.UserInput[0]. This all works fine, but my problem is that when I select a row in the child grid, I need to save a value from a cell in that grid. Using ProcessContext.UserInput just writes over the original value, which ends up removing or displaying incorrect rows in the child grid. Is there any way to store two different values from two different grids on a form? I know this was accomplished in 7.6 with %field.grd1[x], but I don't see anything like that in v9. Any help would be appreciated!
0 -
Got a response from someone on another forum with a solution. Set a local variable with the value from the parent grid and set the BO parameter of the child grid with this local value, not the UserInput value. Then get UserInput of child grid into another local variable.
0 -
I was looking for this myself today and I was suprised to only see references to ProcessContext.UserInput and to assigning the value to a local variable. It is also possible to refer to the field directly although the API wasn't fully documented. To do this use:
Fields.grdName.SelectedRow["colName"].ToString()
where "grdName" and "colName" are the names of the grid and column respectively. This will only work if the grid is marked as having dependants.
0 -
Rob
this could be great to use this instead of userinput, because is not index based. i love it. will Metastorm support this in the feature?0 -
I can't really say what the intent is any longer, but it certainly should be something that is supported IMO.
I've just added an request via the Ideas area to ask for this. Please feel free to chip in there.
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 153 General Questions
- 148 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
- 32 eDOCS
- 190 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 10 XM Fax
- Follow Categories