Multiple Grid Row Selections

Use this board to ask questions or have discussions with other Rich Displays users.
DaveLClarkI
Experienced User
Posts: 165
Joined: Wed Dec 11, 2013 10:40 am
First Name: Dave
Last Name: Clark
Company Name: WinWholesale, Inc.
Phone: 937-294-5331
Address 1: 31101 Kettering Blvd.
City: Dayton
State / Province: Outside Canada/USA
Zip / Postal Code: 45439
Country: United States
Contact:

Multiple Grid Row Selections

Post by DaveLClarkI »

I'm finding that I don't have a good way of knowing which grid rows are actually selected when the page gets submitted back to my RPG code. Currently, I'm using whatever rows are returned as "changed" as the rows that are selected. However, the user can select and deselect any number of grid rows before finally deciding to submit the page and I'm finding that Profound is returning all of those rows as "changed" even though they are not all selected at page submit time. Even with multi-select turned off, the user can select row 1, then row 2, then row 3, and submit the page and my RPG code thinks that all three rows (1, 2, and 3) are selected (changed).

So, how can I tell which rows are actually selected by the time processing gets back to my RPG code?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Multiple Grid Row Selections

Post by Scott Klement »

Bind a variable to the 'selection field' property, and use 'selection value' to indicate the value that gets placed in this field. This field will be an additional field in your subfile record. When you use READC to read the subfile, you can check the variable that's bound to 'selection field' to see if the user left it selected or unselected...
DaveLClarkI
Experienced User
Posts: 165
Joined: Wed Dec 11, 2013 10:40 am
First Name: Dave
Last Name: Clark
Company Name: WinWholesale, Inc.
Phone: 937-294-5331
Address 1: 31101 Kettering Blvd.
City: Dayton
State / Province: Outside Canada/USA
Zip / Postal Code: 45439
Country: United States
Contact:

Re: Multiple Grid Row Selections

Post by DaveLClarkI »

Thanks, I'll check it out when I get back to work on Thursday (after New Year's).
DaveLClarkI
Experienced User
Posts: 165
Joined: Wed Dec 11, 2013 10:40 am
First Name: Dave
Last Name: Clark
Company Name: WinWholesale, Inc.
Phone: 937-294-5331
Address 1: 31101 Kettering Blvd.
City: Dayton
State / Province: Outside Canada/USA
Zip / Postal Code: 45439
Country: United States
Contact:

Re: Multiple Grid Row Selections

Post by DaveLClarkI »

Scott Klement wrote:Bind a variable to the 'selection field' property, and use 'selection value' to indicate the value that gets placed in this field.
I've had a chance to test this, now, and I already had *IN30 bound to "selection field" and that is working when the subfile (grid) is built to preselect a row based on a lookup parameter being passed into my program. However, *IN30 is not being returned when the READC op code is being executed.

Now, since *IN30 is defined as an indicator, do I still have to specify something in the "selection value" in order to get the "selection field" to be returned to my RPG code? If that is the case, do I code '1' as that value?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Multiple Grid Row Selections

Post by Scott Klement »

Yes, I don't think it'll set the selection field at all if you don't also define a selection value. Yes, 1 is the correct value to turn an indicator on.
DaveLClarkI
Experienced User
Posts: 165
Joined: Wed Dec 11, 2013 10:40 am
First Name: Dave
Last Name: Clark
Company Name: WinWholesale, Inc.
Phone: 937-294-5331
Address 1: 31101 Kettering Blvd.
City: Dayton
State / Province: Outside Canada/USA
Zip / Postal Code: 45439
Country: United States
Contact:

Re: Multiple Grid Row Selections

Post by DaveLClarkI »

OK, I tried that and it is still only working as a conditioning indicator and not as a result indicator. I also tried both 1 and '1' and found that specifying '1' caused *IN30 to stop working as a conditioning indicator as well. So, I changed it back to 1 and it now continues to work as a conditioning indicator but still not as a result indicator.

So, might it be that indicators are not going to work for returning the current selected rows back to my RPG code?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Multiple Grid Row Selections

Post by Scott Klement »

You don't want quotes, it'll try to actually put those quotes into the indicator variable if you do that.

I don't know why the indicator wouldn't work, otherwise... I don't know if I've ever coded an *INxx indicator for this, but I would've thought it would work? I guess I could code up a sample program to try it out.

You mention that *IN30 is also being used as a conditioning indicator. What is it conditioning?
DaveLClarkI
Experienced User
Posts: 165
Joined: Wed Dec 11, 2013 10:40 am
First Name: Dave
Last Name: Clark
Company Name: WinWholesale, Inc.
Phone: 937-294-5331
Address 1: 31101 Kettering Blvd.
City: Dayton
State / Province: Outside Canada/USA
Zip / Postal Code: 45439
Country: United States
Contact:

Re: Multiple Grid Row Selections

Post by DaveLClarkI »

Scott Klement wrote:You mention that *IN30 is also being used as a conditioning indicator. What is it conditioning?
It conditions whether a row is preselected when the grid is built. As stated in the Profound documentation, the "selection field" property serves a dual purpose. It is used to both set (conditioning indicator) and return (result indicator) the selected state on each record.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Multiple Grid Row Selections

Post by Scott Klement »

Oh, I see.. thought you were using it to condition something else besides the row selection.

We did a quick test here, and *IN30 worked both with selection value set to 1, and with the selection value unset. Not sure why it's not working for you? Can you tell me how to reproduce the problem?
DaveLClarkI
Experienced User
Posts: 165
Joined: Wed Dec 11, 2013 10:40 am
First Name: Dave
Last Name: Clark
Company Name: WinWholesale, Inc.
Phone: 937-294-5331
Address 1: 31101 Kettering Blvd.
City: Dayton
State / Province: Outside Canada/USA
Zip / Postal Code: 45439
Country: United States
Contact:

Re: Multiple Grid Row Selections

Post by DaveLClarkI »

I have a context menu defined for the grid. I left-click on row 1, then on row 2, and then on row 3. Then, I right-click row 3 and select "Change" from the context menu. The page submits to my RPG program and READC returns all three rows with *IN30 set *off for all three rows.
Last edited by DaveLClarkI on Thu Jan 02, 2014 2:53 pm, edited 1 time in total.
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests