Can you provide or direct me to an explanation of how the Row Selection properties work? (Row Selection, Selection field, Selection value, and Selection image).
I'm trying to develop a grid that allows the user to simply click on a row in a grid and having the RPG program respond by changing other values on the panel. This would be similar to the Category/Products panel in the Grid005 sample, but without having to have a 'Select' column in the Category grid. Just clicking on the category 'row' would cause the contents of the Products subfile/grid to change.
If Row Selection properties can not be used for this purpose, I'd like to understand how they can be used.
How do the Row Selection properties work?
-
- Profound User
- Posts: 30
- Joined: Wed Jun 30, 2010 1:37 pm
- First Name: Thomas
- Last Name: Garvey
- Company Name: Unbeaten Path International
- Country: United States
- Contact:
- David
- Profound Logic Staff Member
- Posts: 690
- Joined: Fri Jan 04, 2008 12:11 pm
- First Name: David
- Last Name: Russo
- Company Name: Profound Logic Software
- Contact:
Re: How do the Row Selection properties work?
You can use the Row selection properties for this purpose, although I'm not sure that this is really what you are after.
The Row selection properties are used to return a "selected" (or not "selected") state on each subfile record to your program.
For example, you might use this to select a set of records to process on another screen.
They work as follows:
1. The "row selection" property will turn on row selection. The user can then select rows by clicking them with the mouse. See the property help text for an explanation of the various values this can be set to.
When rows are selected, a visual "highlighted" effect is applied to them.
2. The "selection field" property is bound to an indicator or character field that gets created in the subfile record format. It is used to both return the selected state (after reading the subfile) or to set the selected state (when writing/updating subfile records).
3. The "selection value" property sets the value used for #2 above. For example, if you bound "selection field" to a 1A field, you might set this to Y. Then, writing a Y into this field in a subfile record will cause it to be selected. Also, you'll get a Y in this field when reading the subfile if the record has been selected by the user.
4. The "selection image" property can be used to specify a background image that will be stretched across each cell in the record to provide the visual "highlighted effect". There is a default blue one that is used if this is not specified. You might use this to provide your own style if the blue color doesn't work for you.
Does this explain it?
In regard to your requirement...
I would recommend doing this instead with the "onrowclick" and "cursor record number" properties instead. This is simpler if all you want to do is process a click on a single row. It could work like this:
1. Set "onrowclick" to:
pui.click();
This will simulate an Enter key press when the user clicks on a row.
2. Bind "cursor record number" to a numeric field. This will get the RRN of the subfile record the user clicked on. You can then CHAIN to get the subfile record, and then re-display the screen with whatever updates you need.
The Row selection properties are used to return a "selected" (or not "selected") state on each subfile record to your program.
For example, you might use this to select a set of records to process on another screen.
They work as follows:
1. The "row selection" property will turn on row selection. The user can then select rows by clicking them with the mouse. See the property help text for an explanation of the various values this can be set to.
When rows are selected, a visual "highlighted" effect is applied to them.
2. The "selection field" property is bound to an indicator or character field that gets created in the subfile record format. It is used to both return the selected state (after reading the subfile) or to set the selected state (when writing/updating subfile records).
3. The "selection value" property sets the value used for #2 above. For example, if you bound "selection field" to a 1A field, you might set this to Y. Then, writing a Y into this field in a subfile record will cause it to be selected. Also, you'll get a Y in this field when reading the subfile if the record has been selected by the user.
4. The "selection image" property can be used to specify a background image that will be stretched across each cell in the record to provide the visual "highlighted effect". There is a default blue one that is used if this is not specified. You might use this to provide your own style if the blue color doesn't work for you.
Does this explain it?
In regard to your requirement...
I would recommend doing this instead with the "onrowclick" and "cursor record number" properties instead. This is simpler if all you want to do is process a click on a single row. It could work like this:
1. Set "onrowclick" to:
pui.click();
This will simulate an Enter key press when the user clicks on a row.
2. Bind "cursor record number" to a numeric field. This will get the RRN of the subfile record the user clicked on. You can then CHAIN to get the subfile record, and then re-display the screen with whatever updates you need.
Who is online
Users browsing this forum: No registered users and 2 guests