Assume I have two (or many) ComboBox (combo1, combo2) with same Choice-List.
Now I need to exclude that User can choice same Value for combo1 and combo2:
when user select "A" for combo1 and than again "A" for combo2, I need to set
combo1.Value to something that is not in Choice-List (e.g. None or empty
String), like after Initialization before any Selection.
Assume I have two (or many) ComboBox (combo1, combo2) with same Choice-List. Now I need to exclude that User can choice same Value for combo1 and combo2:
when user select "A" for combo1 and than again "A" for combo2, I need to set
combo1.Value to something that is not in Choice-List (e.g. None or empty
String), like after Initialization before any Selection.
Is there such a thing? Or any better solution?
___
Just bind both combo boxes to EVT_COMBOBOX and let the handler figure it out.
Of course, you could also just delete the option from the 2nd combo when the user chooses it from the first. Sounds like a rather silly application anyway. If you want someone to be able to choose multiple items, you should use a ListBox.
Mike Driscoll <mike <at> pythonlibrary.org> writes:
<psuedo-code>
if valTwo == valOne:
self.comboOne.SetValue("")
</psuedo-code>
It's don't work when '' not a Value in Choice-List or not??
Sounds like a rather silly
application anyway.
Assume You have List of PersId for Department with lot of People:
combo1 is select Manager (it's only one here)
combo2 is select Secretary (it's only one here)
Is this so silly?
If you want someone to be able to choose multiple
items, you should use a ListBox.
Mike Driscoll <mike <at> pythonlibrary.org> writes:
<psuedo-code>
if valTwo == valOne:
self.comboOne.SetValue("")
</psuedo-code>
It's don't work when '' not a Value in Choice-List or not??
Sounds like a rather silly application anyway.
Assume You have List of PersId for Department with lot of People: combo1 is select Manager (it's only one here)
combo2 is select Secretary (it's only one here)
Is this so silly?
No, that's not silly. But you didn't say you had two different lists. The way I understood it was that both lists had the same items and you didn't want someone to choose the same item in each combobox. I don't really understand what you want. Hopefully someone else can figure this out...
On Fri, Oct 31, 2008 at 6:45 AM, Ur <mybox4spam-wxpython@yahoo.com> wrote:
Assume I have two (or many) ComboBox (combo1, combo2) with same Choice-List.
Now I need to exclude that User can choice same Value for combo1 and combo2:
when user select "A" for combo1 and than again "A" for combo2, I need to set
combo1.Value to something that is not in Choice-List (e.g. None or empty
String), like after Initialization before any Selection.
Mike Driscoll <mike <at> pythonlibrary.org> writes:
Ur wrote:
>
> Assume You have List of PersId for Department with lot of People:
> combo1 is select Manager (it's only one here)
> combo2 is select Secretary (it's only one here)
No, that's not silly. But you didn't say you had two different lists.
The way I understood it was that both lists had the same items and you
didn't want someone to choose the same item in each combobox. I don't
really understand what you want. Hopefully someone else can figure this
out...
Mike
Hi Mike,
thank You for spending time and for suggestions. I'm sorry, it's not easy for me
to explain it in english, so its possible that it was ambiguous or obscure.
Sure, each ComboBox have its own Value-List, but its correspond to same
PersonalId-List. I need to satisfy:
we have persId = (001, 002, 003, 004)
if User select Manager: 001 in Combo1 and then select Secretary: 001 in Combo2,
then this break my constraint - one Person is either Manager or Secretary,
then my purpose is to set Manager Id to "undefined" and appropriate to set Value
for Manager-Combo1 to empty String (it's not in persId).
Mike Driscoll <mike <at> pythonlibrary.org> writes:
Ur wrote:
Assume You have List of PersId for Department with lot of People: combo1 is select Manager (it's only one here)
combo2 is select Secretary (it's only one here)
No, that's not silly. But you didn't say you had two different lists. The way I understood it was that both lists had the same items and you didn't want someone to choose the same item in each combobox. I don't really understand what you want. Hopefully someone else can figure this out...
Mike
Hi Mike,
thank You for spending time and for suggestions. I'm sorry, it's not easy for me
to explain it in english, so its possible that it was ambiguous or obscure.
Sure, each ComboBox have its own Value-List, but its correspond to same
PersonalId-List. I need to satisfy:
we have persId = (001, 002, 003, 004)
if User select Manager: 001 in Combo1 and then select Secretary: 001 in Combo2, then this break my constraint - one Person is either Manager or Secretary,
then my purpose is to set Manager Id to "undefined" and appropriate to set Value
for Manager-Combo1 to empty String (it's not in persId).
No problem. English isn't an easy language. Did you look at Timothy's solution? I still think you could use the EVT_COMBOBOX to change the list in the 2nd box. So if you're a Manager and you choose that in the first combo, then in the handler you can change the list of the 2nd combo so that there are no conflicts (or vice versa).