View Full Version : Possible ListBox bug?
I have tried to get this data in many ways, but it never shows
Input.SetText("Input1", ListBox.GetItemData("ListBox1", ListBox.GetSelected("ListBox1")));
It's always blank. Even tried dialog box.
Am I doing something wrong?
Corey
12-31-2003, 02:18 AM
Hi. It's not a bug, please do me a favor and refrain from using the word "bug" in your posts until you've had a chance to familiarize yourself with AMS, thanks, it helps us keep the posts straight, etc... :)
OK so as to your question. Yes, you are attempting to add functions in a non-parsable manner. I have created a sample project for you which extracts the item text from a listbox and displays it in a dialog. Very easy, one action. The action is on the page's OnShow event, you can download the file here I've attached it to this post. It's self explanatory.
Please feel free to post any follow up questions you may have once you have had a chance to download and view the attached source file and I'll be happy to assist further. Also, please consider taking an hour and reading through the included getting started guide, believe me, it'll shave hours off your design time and you'll have more fun with the product. :) Normally I don't believe in the docs which come with software but our docs are the best around, Lorne did a great job on them, and I stand by them 100%. I guarantee you will not regret it if you read through them. :)
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
Corey
12-31-2003, 02:19 AM
ATTACHED PROJECT FILE
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
Corey
12-31-2003, 02:23 AM
BTW here's a second sample project which concatenates (joins) together the item text and item data and displays that. This is what it seems like you were trying to do. As you can see it's simply a matter of concatenating the functions with the .. operator rather than nesting them. Easier on the eyes this way too. :)
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
THanks, but that's not what I am really trying to do.
I need to get the itemdata of the selected item. Since you don't know the selected item index, u need to get it dynamically.
I even tried this
s=ListBox.GetSelected("ListBox1");
ss=ListBox.GetItemData("ListBox1", s);
Dialog.Message("Info",ss);
Stefan_M
12-31-2003, 09:53 AM
Hi,
the action ListBox.GetSelected returns a table.
You have to select the first item for single selection.
s=ListBox.GetSelected("ListBox1");
ss=ListBox.GetItemData("ListBox1", s[1]);
Dialog.Message("Info",ss);
Stefan
ahhhh...yes!
THank you very much!
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.