1. Greg Bergbower
  2. PowerBuilder
  3. Thursday, 20 February 2020 16:13 PM UTC

I need a control on a datawindow which allows the user to make multiple selections.  Because a drop-down listbox does not allow for multi-select, I wanted to utilize a listbox control.  However, it does not appear a listbox control can be added to a datawindow.  First question, can you confirm whether or not a listbox control can be added to a datawindow?  If yes, how?  If no, then what alternatives are there for allowing a user to make multiple selections from a single list on a datawindow?

 

thank you,

greg

Accepted Answer
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Friday, 21 February 2020 14:08 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Greg

What John has said is all perfecty ture and I'm assuming that you want a comma separate list of the value selected to store? Or at least something like that.

What you can do is overlay a DW control on top of your main DW control with the list of items, the use would select the row (items in the list) and then the lose focus would collect these and setitem on the main dw. You would make this overlay DW control visible and Not as required and also position it relative to the current column / row in use.

Just my thoughts on this one.

Cheers

David

Comment
  1. Greg Bergbower
  2. Friday, 21 February 2020 14:18 PM UTC
Your assumption is correct, I would be saving the selections as a comma separated list. Thank you for the response.
  1. Helpful
  1. David Peace (Powersoft)
  2. Friday, 21 February 2020 17:10 PM UTC
You are welcome :)
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 20 February 2020 17:06 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Greg -

I assume you are asking about making multiple selections in a column object that utilizes either the Drop-Down DataWindow (DDDW) or Drop-Down ListBox (DDLB) edit styles.

The DDDW & DDLB edit styles provide a mechanism whereby each possible data value (an ID number, for example) is visually mapped to a display value (such as a name). Since a column DataWindow object represents a single data value, When a single selection is made, the corresponding data value is placed in the row/column in the data buffer.

My question to you: How should multiple selections in the (multiple names, for example) presentation be represented in a single data value (ID)? You're wanting to force multiple data values into a container that can hold only one value. You'd also have to somehow be able to parse or decode the single data value back into multiple selections.

Regards, John

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 21 February 2020 15:28 PM UTC
  2. PowerBuilder
  3. # 2

Hi Greg;

   This is very easy to do and I have needed to do this type of multi-value processing in my PB Apps for decades.

   How I approach the the problem is to use a CommandButton beside the multi-value column. When the App User clicks the "..." CB, I open (with Parm) a Response Window that uses a "Tabular" or "Grid" style DataWindow and in the Message object pass in a Structure with array elements.

   In the response window's DW Control, I support multi-row selects. Then when complete and the user closes the Multi-row selection window, I copy the selected DWO datum to the passed-in structure and then perform a CloseWithReturn command. The receiving (in calling Window) DWO on the "Button Clicked" event that called the response window then introspects the returned structure and processes the multi-value array data as your business users require. This design of course could then update multiple DWO columns within various DWO's as required and not just a single parent column like a DDDW.

  Food for thought.  ;-)

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.