Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » BUG? DropList shows first of entries with same key
BUG? DropList shows first of entries with same key [message #32143] Wed, 27 April 2011 17:34 Go to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
hi
a DropList with such entries
	dl.Add(100, "Apple");
	dl.Add(100, "Cherry");
	dl.Add(101, "Pear");
	dl.Add(100, "Berry");

will always show 'Apple' even if Cherry or Berry are selected.
it's due to Sync() method which key.Find()'s the value of the first entry only..(typical Map/Index behaviour).

it'd be great to be able to select the entries independantly, even if they got the same key..

is that possible somehow?

[Updated on: Wed, 27 April 2011 17:35]

Report message to a moderator

Re: BUG? DropList shows first of entries with same key [message #32201 is a reply to message #32143] Sat, 30 April 2011 13:12 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kohait00 wrote on Wed, 27 April 2011 11:34

hi
a DropList with such entries
	dl.Add(100, "Apple");
	dl.Add(100, "Cherry");
	dl.Add(101, "Pear");
	dl.Add(100, "Berry");

will always show 'Apple' even if Cherry or Berry are selected.
it's due to Sync() method which key.Find()'s the value of the first entry only..(typical Map/Index behaviour).

it'd be great to be able to select the entries independantly, even if they got the same key..

is that possible somehow?


Its a feature. In fact, correct solution would be ASSERT that ensures that the key is unique.

The value of DropList is defined by key. Value is just for display reason.
Re: BUG? DropList shows first of entries with same key [message #32227 is a reply to message #32201] Mon, 02 May 2011 10:12 Go to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
logical Smile thanks
Previous Topic: static Ctrl causes running failure
Next Topic: Wanted : Graphic designer
Goto Forum:
  


Current Time: Fri Mar 29 00:10:11 CET 2024

Total time taken to generate the page: 0.01153 seconds