2008-01-01, 05:09 PM
idkpmiller Wrote:First off the andatory, Happy New Year!
JavaWiz if you have time could you post a routine to handle files in your list I am trying to add two properties @text which I use to store the filename without the path and extention (shortname) and @tag which I am using to store the longname this includes the pathand extention.
I would like to display just the shortname but upon selection etrive the shortname and the longname selected.
I am having issues getting this to workas I want it, do you have any example snippets of code that would show me how the uilist works better with multiple properties
Thanks
I do that a little differently. I create a sorted list that contains objects that have both the shortname and longname stored in it. After I create the sortedlist with all of these, I then set the wizlist with
Code:
[SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][SIZE=2] setwizlist()
{
[/SIZE][SIZE=2][COLOR=#2b91af]ArrayList[/COLOR][/SIZE][SIZE=2] itemList = [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2][COLOR=#2b91af]ArrayList[/COLOR][/SIZE][SIZE=2]();
[/SIZE][SIZE=2][COLOR=#0000ff]for[/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][SIZE=2] i = 0; i < fileList.Count; i++)
{
[/SIZE][SIZE=2][COLOR=#2b91af]FileObject[/COLOR][/SIZE][SIZE=2] fileObject = ([/SIZE][SIZE=2][COLOR=#2b91af]FileObject[/COLOR][/SIZE][SIZE=2])fileList.GetByIndex(i);
[/SIZE][SIZE=2][COLOR=#2b91af]WizUiList[/COLOR][/SIZE][SIZE=2].[/SIZE][SIZE=2][COLOR=#2b91af]WizListItem[/COLOR][/SIZE][SIZE=2] item = [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2][COLOR=#2b91af]WizUiList[/COLOR][/SIZE][SIZE=2].[/SIZE][SIZE=2][COLOR=#2b91af]WizListItem[/COLOR][/SIZE][SIZE=2]();
item.AddProperty([/SIZE][SIZE=2][COLOR=#a31515]"@text"[/COLOR][/SIZE][SIZE=2], fileObject.Shortname);
[/SIZE][SIZE=2]itemList.Add(item);
}
lstMyList1.setItemList(itemList);
[/SIZE]
text is what gets displayed. I did it this way because there was a lot of legacy code from tmrt that I didn't want to change that referenced the fileobject within the sortedlist
When I have a selected item in the wizuilist, it references the same spot in the other list. This does seem a little redundant but it works..
You could easily change this to add another property to add a longname.
I can post the code that creates the sortedlist if you want too.