Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Newbie Question: Multiple Select ListBox

4 posts in Objects Last posting was on 2003-02-13 20:45:02.0Z
Henry Posted on 2002-12-26 16:14:31.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Henry
Date: Thu, 26 Dec 2002 11:14:31 -0500
Subject: Newbie Question: Multiple Select ListBox
Lines: 10
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_007FDF513C4C76120059384685256C9B.0059389A85256C9B@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:671
Article PK: 713243

i am re-educating myself on powerbuilder and have a question that seems
like it should be a pretty easy thing to solve so here goes...

i need a control that displays multiple items and allows you to select
multiple items. ideally a listbox allowing multiple select would work but
for some reason i can't figure out a way to capture the selected values.
all i see is the SelectedItem() function which only returns the FIRST of
the many selected items. this control even has a function that returns the
number of items selected. i feel like the ListBox accomodates everything
BUT the values of the selected items. am i overlooking something obvious
here? please advise.


Plaga_Nerezza Posted on 2003-02-13 20:45:02.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Plaga_Nerezza
Date: Thu, 13 Feb 2003 15:45:02 -0500
Subject: Re: Newbie Question: Multiple Select ListBox
Lines: 13
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_A8EAD3C10A4F84CB0071FCBC85256CCC.005CAA1885256C9B@webforums>
References: <364_007FDF513C4C76120059384685256C9B.0059389A85256C9B@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:109
Article PK: 712682

You need to create an array called "Resources[]" That will store multiple
values. You than need to implode the array to a string. You can than
insert the string.

<SELECT NAME="your_col[]" MULTIPLE>
<OPTION VALUE="Ag">Ag</option>
<OPTION VALUE="B">B</option>
<OPTION VALUE="C">C</option>
<OPTION VALUE="D">D</option></SELECT>

$comma_separated = implode(",", $Resources);

"Insert into your_table set your_col = '$comma_separated'";


Scott Morris Posted on 2002-12-26 16:53:30.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Scott Morris" <bogus@microsoft.com>
Subject: Re: Newbie Question: Multiple Select ListBox
Date: Thu, 26 Dec 2002 11:53:30 -0500
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: ip45-gadivinv-a8.atl1.exsbs.net 65.205.162.45
Message-ID: <364_O72oNHQrCHA.287@forums.sybase.com>
References: <364_007FDF513C4C76120059384685256C9B.0059389A85256C9B@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:670
Article PK: 713235

Taken directly from online help -

SelectedIndex and SelectedItem are meant for lists that allow a single
selection only (when the MultiSelect property for the control is FALSE).

When the MultiSelect property is TRUE, SelectedItem gets the text of the
first selected item only. Use the State function, instead of SelectedItem,
to check each item in the list and find out if it is selected. Use the Text
function to get the text of any item in the list.

<Henry> wrote in message
news:007FDF513C4C76120059384685256C9B.0059389A85256C9B@webforums...
> i am re-educating myself on powerbuilder and have a question that seems
> like it should be a pretty easy thing to solve so here goes...
>
> i need a control that displays multiple items and allows you to select
> multiple items. ideally a listbox allowing multiple select would work but
> for some reason i can't figure out a way to capture the selected values.
> all i see is the SelectedItem() function which only returns the FIRST of
> the many selected items. this control even has a function that returns
the
> number of items selected. i feel like the ListBox accomodates everything
> BUT the values of the selected items. am i overlooking something obvious
> here? please advise.


Henry Posted on 2002-12-26 18:11:51.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Henry
Date: Thu, 26 Dec 2002 13:11:51 -0500
Subject: Re: Newbie Question: Multiple Select ListBox
Lines: 1
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_D57B8209AE0D30B20063F64C85256C9B.0062574185256C9B@webforums>
References: <364_007FDF513C4C76120059384685256C9B.0059389A85256C9B@webforums> <364_O72oNHQrCHA.287@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:669
Article PK: 713236

that works perfectly. thank you, very much.