Hi,
I wonder whether anyone has seen this behaviour with containers in VisPro Rexx:
I have a container (details view) within a notebook page. I can load up data into it no problem. However, no matter which row I select, the VpGetItemValue (using index) always returns me the last row's values, even though the index returned does change as I click through the rows .
The container has a symbol of CNT_CGI and I have an Edit button who's When Clicked/Selected event code is as follows (this is test code to just show some message boxes: I have commented out the fuller version but the same bug of the last row's values returned persists):
Arg window self
/* Get index of selected item */
index = VpGetIndex(window, 'CNT_CGI', 'SELECTED', 0)
if index = 0 then
response = VpMessageBox(window, 'Error', 'No CGI item was selected')
else do
value = VpGetItemValue(window, 'CNT_CGI', index)
cgiName = value.1
message = 'You selected the' cgiName 'CGI entry'
response = VpMessageBox(window, index, message)
end
value = ''
index = 0
The initial VpGetIndex() call seems to work as when I click through entries, the 'index' variable is shown to change and returns consistent values for the rows I click on (eg if row 1 is 1234567 and row 2 is 567879, I always get 1234567 for row 1 and always get 56789 for row 2)
But the cgiName value is always the last row's value
The problem seems to be with the subsequent VpGetItemValue() call. For some reason it seems to disregard the value of index.
Any ideas?
PS - I tried using a list box as thses use the same methods, and it works fine for those (ie always returns me the correct row's single value).