Multi select in a powerbuilder data window

  • Questions
  • Multi select in a powerbuilder data window
Question ID: 105986

I am trying to work with a power builder data window object. I have to select multiple items in the list. When I do a select method, each time I select an item it deselects the previous one. Is there a way to do a multiple selection? I don’t see a method to allow this in the PbDatawindow object help.

Marked as spam
Posted by (Questions: 184, Answers: 22)
Asked on April 1, 2015 1:24 pm
Answers (1)
Private answer

Try giving this a shot -

To make this example simple, I am using a variable listTotal to control the loop of the total number of items in the list. Use this as a template and adjust according to your specific needs:

listTotal = 5

'Press down the Control key for multi-selection
PbWindow(''w_mainframe'').PbWindow(''w_vendors'').PbDataWindow(''dw_vendor_list'').Type micCtrlDwn

'Loop through list and select items by index number instead of string (while still holding down the control key)

For selectItem = 0 to listTotal
PbWindow(''w_mainframe'').PbWindow(''w_vendors'').PbDataWindow(''dw_vendor_list'').SelectCell ''#'' & selectItem, ''vendor_name''

'Release the Control Key
PbWindow(''w_mainframe'').PbWindow(''w_vendors'').PbDataWindow(''dw_vendor_list'').Type micCtrlUp

'Close the list object

Marked as spam
Posted by (Questions: 2, Answers: 434)
Answered on April 1, 2015 1:27 pm