weblistbox 2014 r3.2 workaround

The weblistbox being one of the most common controls in use and yet it seems even in the last release of 2014 it still doesn’t function properly?

While trying to populate a listbox (‘lbTrackSelection’) I am encountering an error stating there are more than one instances of the listbox.

for i as integer = 0 to app.trackArray.Ubound
lbTrackSelection.cell(i,1)= app.trackArray(i).theme
lbTrackSelection.cell(i,0)= app.trackArray(i).variance
next

I have saved the file as a dojo project file and binary project file still no joy?

Any ideas would be helpful…
Thanks

The WebListbox has always been working for me.

Is it a compile error or a runtime error?
And what is the exact error message?

Hi Eli

Thanks for your response…

Compile error ‘There is more than one item with this name and it’s not clear to which this refers’
Also tried ‘TrackList.InsertRow(0, app.trackArray(0).theme, app.trackArray(0).variance)’
after changing listbox name to TrackList.

Tried putting listbox within container control but still throwing up the same error message

On which line?

tried this

for i as integer = 0 to app.trackArray.Ubound

TrackList.InsertRow(0, app.trackArray(0).theme, app.trackArray(0).variance)  <<<<<

next

<<<<<<< this cause same error message

Are theme and/or variance properties of type String or of type Variant? If yes try it with .StringValue:

TrackList.InsertRow(0, app.trackArray(0).theme.StringValue, app.trackArray(0).variance.StringValue)

Hey Eli

Got it working! …Thanks for your help…
Deleted both listboxs I suspect that there may have been one of the column headings which may have caused the error.
I can’t be sure what the exact issue was but hey its working.

That is very strange in 2014. That kind of error message is typical of 2015 compiling, and it happens most often when a type error occurs. Like affecting a string to an integer or the opposite.

Anyway, the most important is that it works. Never complain about a miracle :wink:

After looking at it more closely, (its bad enough when things don’t work but worse when they work but you don’t know why!) I think you are absolutely right Michel I was trying to populate the list box with an integer from an array.

oops haven’t used xojo web for ages and was totally fooled by the random error message…

[quote=219424:@James Moore]After looking at it more closely, (its bad enough when things don’t work but worse when they work but you don’t know why!) I think you are absolutely right Michel I was trying to populate the list box with an integer from an array.

oops haven’t used xojo web for ages and was totally fooled by the random error message…[/quote]

I have to admit the ‘more than one item’ had me puzzled for a while… Previous Xojo versions error messages were much more precise.