Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » setting default value in Combo doesn't trigger an event
setting default value in Combo doesn't trigger an event [message #493175] Fri, 23 October 2009 13:21 Go to next message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
Hi all,
I've created two Combos. If I change the selection in Combo1, the value
of Combo2 should reset to default value. I got this as follows:

myCombo1.addPostSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent arg0) {
myCombo2.refresh(false);
myCombo2.getCombo().select(0);
}
});

The value is set correctly to the first in the list, but the model
behind the combo2 doesn't recognize this change. How can I achieve that
the model is updated, too?

Thanks in advance,
Ralf.
Re: setting default value in Combo doesn't trigger an event [message #493203 is a reply to message #493175] Fri, 23 October 2009 15:20 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
did you try
myCombo2.setSelection( StructuredSelection.EMPTY );
in the selectionChanged method?

HTH
Rüdiger

R. Heydenreich wrote:
> Hi all,
> I've created two Combos. If I change the selection in Combo1, the value
> of Combo2 should reset to default value. I got this as follows:
>
> myCombo1.addPostSelectionChangedListener(new ISelectionChangedListener() {
> public void selectionChanged(SelectionChangedEvent arg0) {
> myCombo2.refresh(false);
> myCombo2.getCombo().select(0);
> }
> });
>
> The value is set correctly to the first in the list, but the model
> behind the combo2 doesn't recognize this change. How can I achieve that
> the model is updated, too?
>
> Thanks in advance,
> Ralf.
Re: setting default value in Combo doesn't trigger an event [message #493426 is a reply to message #493203] Mon, 26 October 2009 08:31 Go to previous messageGo to next message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
Rüdiger Herrmann schrieb:
> did you try
> myCombo2.setSelection( StructuredSelection.EMPTY );
> in the selectionChanged method?
>
> HTH
> Rüdiger

Hi Rüdiger,
this doesn't set the value, too. If I select any value in combo2 and
after this select a value in combo1, the combo2 doesn't refresh its
(displayed resp. selected) value. The values inside combo2 are
refreshed. Any further hints are welcome.

Regards,
Ralf.

>
> R. Heydenreich wrote:
>> Hi all,
>> I've created two Combos. If I change the selection in Combo1, the value
>> of Combo2 should reset to default value. I got this as follows:
>>
>> myCombo1.addPostSelectionChangedListener(new
>> ISelectionChangedListener() {
>> public void selectionChanged(SelectionChangedEvent arg0) {
>> myCombo2.refresh(false);
>> myCombo2.getCombo().select(0);
>> }
>> });
>>
>> The value is set correctly to the first in the list, but the model
>> behind the combo2 doesn't recognize this change. How can I achieve that
>> the model is updated, too?
>>
>> Thanks in advance,
>> Ralf.
Re: setting default value in Combo doesn't trigger an event [message #493462 is a reply to message #493426] Mon, 26 October 2009 12:19 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Ralf,

I understood that you wanted to reset the selection of combo 2. This
is what "setSelection( StructuredSelection.EMPTY )" does.
If that's not what you wanted to do, then please clarify what you
actually want to achieve.

Regards,
Rüdiger


R. Heydenreich wrote:
> Rüdiger Herrmann schrieb:
>> did you try
>> myCombo2.setSelection( StructuredSelection.EMPTY );
>> in the selectionChanged method?
>>
>> HTH
>> Rüdiger
>
> Hi Rüdiger,
> this doesn't set the value, too. If I select any value in combo2 and
> after this select a value in combo1, the combo2 doesn't refresh its
> (displayed resp. selected) value. The values inside combo2 are
> refreshed. Any further hints are welcome.
>
> Regards,
> Ralf.
>
>> R. Heydenreich wrote:
>>> Hi all,
>>> I've created two Combos. If I change the selection in Combo1, the value
>>> of Combo2 should reset to default value. I got this as follows:
>>>
>>> myCombo1.addPostSelectionChangedListener(new
>>> ISelectionChangedListener() {
>>> public void selectionChanged(SelectionChangedEvent arg0) {
>>> myCombo2.refresh(false);
>>> myCombo2.getCombo().select(0);
>>> }
>>> });
>>>
>>> The value is set correctly to the first in the list, but the model
>>> behind the combo2 doesn't recognize this change. How can I achieve that
>>> the model is updated, too?
>>>
>>> Thanks in advance,
>>> Ralf.
Re: setting default value in Combo doesn't trigger an event [message #493474 is a reply to message #493462] Mon, 26 October 2009 12:54 Go to previous messageGo to next message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
Rüdiger Herrmann schrieb:
> Ralf,
>
> I understood that you wanted to reset the selection of combo 2. This is
> what "setSelection( StructuredSelection.EMPTY )" does.
> If that's not what you wanted to do, then please clarify what you
> actually want to achieve.
>
> Regards,
> Rüdiger

Hi Rüdiger,
what I want to get is the following scenario:
1. (initial) both combos are filled with some values, and on both combos
the first value is highlighted (here marked with an asterisk):

combo1 (c1) combo2 (c2)
+----------------+ +-----------------+
|*default_combo1 | |*default_a_combo2|
+-----------+----+ +------------+----+
|c1_val_1 | |c2_val_a1 |
|c1_val_2 | |c2_val_a2 |
|c1_val_3 | |c2_val_a3 |
+-----------+ +------------+

2. next, I select a value in combo2:

combo1 combo2
+----------------+ +-----------------+
|*default_combo1 | |*c2_val_a2 |
+-----------+----+ +------------+----+
|c1_val_1 | |c2_val_a1 |
|c1_val_2 | |default_a_co|
|c1_val_3 | |c2_val_a3 |
+-----------+ +------------+

Nothing else happens, and this is ok.

3. Now I select another value in combo1. At this point the content of
combo2 is completely replaced by other values. And I recognize that the
new default value is displayed. But the situation is as follows:

=> WRONG
combo1 combo2
+-----------------+ +-----------------+
|*c1_val_2 | |*default_a_combo2|
+-----------+-----+ +------------+----+
|c1_val_1 | |default_b_co|
|default_com| |c2_val_b2 |
|c1_val_3 | |c2_val_b3 |
+-----------+ |c2_val_b3 |
+------------+

The value default_a_combo2 is displayed, but it is not an element of the
content of combo2. The question is, how can I get the combo2 so that it
displays after a change in combo1 the default value default_b_combo2 and
not the previously selected value?

=> INTENDED BEHAVIOUR:
combo1 combo2
+-----------------+ +-----------------+
|*c1_val_2 | |*default_b_combo2|
+-----------+-----+ +------------+----+
|c1_val_1 | |c2_val_b2 |
|default_com| |c2_val_b3 |
|c1_val_3 | |c2_val_b3 |
+-----------+ +------------+

Does this clarify my intention?

Regards,
Ralf.

>
>
> R. Heydenreich wrote:
>> Rüdiger Herrmann schrieb:
>>> did you try
>>> myCombo2.setSelection( StructuredSelection.EMPTY );
>>> in the selectionChanged method?
>>>
>>> HTH
>>> Rüdiger
>>
>> Hi Rüdiger,
>> this doesn't set the value, too. If I select any value in combo2 and
>> after this select a value in combo1, the combo2 doesn't refresh its
>> (displayed resp. selected) value. The values inside combo2 are
>> refreshed. Any further hints are welcome.
>>
>> Regards,
>> Ralf.
>>
>>> R. Heydenreich wrote:
>>>> Hi all,
>>>> I've created two Combos. If I change the selection in Combo1, the value
>>>> of Combo2 should reset to default value. I got this as follows:
>>>>
>>>> myCombo1.addPostSelectionChangedListener(new
>>>> ISelectionChangedListener() {
>>>> public void selectionChanged(SelectionChangedEvent arg0) {
>>>> myCombo2.refresh(false);
>>>> myCombo2.getCombo().select(0);
>>>> }
>>>> });
>>>>
>>>> The value is set correctly to the first in the list, but the model
>>>> behind the combo2 doesn't recognize this change. How can I achieve that
>>>> the model is updated, too?
>>>>
>>>> Thanks in advance,
>>>> Ralf.
Re: setting default value in Combo doesn't trigger an event [message #493620 is a reply to message #493474] Tue, 27 October 2009 09:27 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
do you want to select an element in a combo viewer that is not part
of its content (i.e. is not returned by
IStructuredContentProvider#getElements)?
Is that what you want to achieve?


R. Heydenreich wrote:
> Rüdiger Herrmann schrieb:
>> Ralf,
>>
>> I understood that you wanted to reset the selection of combo 2. This is
>> what "setSelection( StructuredSelection.EMPTY )" does.
>> If that's not what you wanted to do, then please clarify what you
>> actually want to achieve.
>>
>> Regards,
>> Rüdiger
>
> Hi Rüdiger,
> what I want to get is the following scenario:
> 1. (initial) both combos are filled with some values, and on both combos
> the first value is highlighted (here marked with an asterisk):
>
> combo1 (c1) combo2 (c2)
> +----------------+ +-----------------+
> |*default_combo1 | |*default_a_combo2|
> +-----------+----+ +------------+----+
> |c1_val_1 | |c2_val_a1 |
> |c1_val_2 | |c2_val_a2 |
> |c1_val_3 | |c2_val_a3 |
> +-----------+ +------------+
>
> 2. next, I select a value in combo2:
>
> combo1 combo2
> +----------------+ +-----------------+
> |*default_combo1 | |*c2_val_a2 |
> +-----------+----+ +------------+----+
> |c1_val_1 | |c2_val_a1 |
> |c1_val_2 | |default_a_co|
> |c1_val_3 | |c2_val_a3 |
> +-----------+ +------------+
>
> Nothing else happens, and this is ok.
>
> 3. Now I select another value in combo1. At this point the content of
> combo2 is completely replaced by other values. And I recognize that the
> new default value is displayed. But the situation is as follows:
>
> => WRONG
> combo1 combo2
> +-----------------+ +-----------------+
> |*c1_val_2 | |*default_a_combo2|
> +-----------+-----+ +------------+----+
> |c1_val_1 | |default_b_co|
> |default_com| |c2_val_b2 |
> |c1_val_3 | |c2_val_b3 |
> +-----------+ |c2_val_b3 |
> +------------+
>
> The value default_a_combo2 is displayed, but it is not an element of the
> content of combo2. The question is, how can I get the combo2 so that it
> displays after a change in combo1 the default value default_b_combo2 and
> not the previously selected value?
>
> => INTENDED BEHAVIOUR:
> combo1 combo2
> +-----------------+ +-----------------+
> |*c1_val_2 | |*default_b_combo2|
> +-----------+-----+ +------------+----+
> |c1_val_1 | |c2_val_b2 |
> |default_com| |c2_val_b3 |
> |c1_val_3 | |c2_val_b3 |
> +-----------+ +------------+
>
> Does this clarify my intention?
>
> Regards,
> Ralf.
>
>>
>> R. Heydenreich wrote:
>>> Rüdiger Herrmann schrieb:
>>>> did you try
>>>> myCombo2.setSelection( StructuredSelection.EMPTY );
>>>> in the selectionChanged method?
>>>>
>>>> HTH
>>>> Rüdiger
>>> Hi Rüdiger,
>>> this doesn't set the value, too. If I select any value in combo2 and
>>> after this select a value in combo1, the combo2 doesn't refresh its
>>> (displayed resp. selected) value. The values inside combo2 are
>>> refreshed. Any further hints are welcome.
>>>
>>> Regards,
>>> Ralf.
>>>
>>>> R. Heydenreich wrote:
>>>>> Hi all,
>>>>> I've created two Combos. If I change the selection in Combo1, the value
>>>>> of Combo2 should reset to default value. I got this as follows:
>>>>>
>>>>> myCombo1.addPostSelectionChangedListener(new
>>>>> ISelectionChangedListener() {
>>>>> public void selectionChanged(SelectionChangedEvent arg0) {
>>>>> myCombo2.refresh(false);
>>>>> myCombo2.getCombo().select(0);
>>>>> }
>>>>> });
>>>>>
>>>>> The value is set correctly to the first in the list, but the model
>>>>> behind the combo2 doesn't recognize this change. How can I achieve that
>>>>> the model is updated, too?
>>>>>
>>>>> Thanks in advance,
>>>>> Ralf.
Re: setting default value in Combo doesn't trigger an event [message #493658 is a reply to message #493620] Tue, 27 October 2009 13:45 Go to previous messageGo to next message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
Rüdiger Herrmann schrieb:
> do you want to select an element in a combo viewer that is not part of
> its content (i.e. is not returned by
> IStructuredContentProvider#getElements)?
> Is that what you want to achieve?

No, I want only select the elements which are part of the list.

>
>
> R. Heydenreich wrote:
>> Rüdiger Herrmann schrieb:
>>> Ralf,
>>>
>>> I understood that you wanted to reset the selection of combo 2. This is
>>> what "setSelection( StructuredSelection.EMPTY )" does.
>>> If that's not what you wanted to do, then please clarify what you
>>> actually want to achieve.
>>>
>>> Regards,
>>> Rüdiger
>>
>> Hi Rüdiger,
>> what I want to get is the following scenario:
>> 1. (initial) both combos are filled with some values, and on both combos
>> the first value is highlighted (here marked with an asterisk):
>>
>> combo1 (c1) combo2 (c2)
>> +----------------+ +-----------------+
>> |*default_combo1 | |*default_a_combo2|
>> +-----------+----+ +------------+----+
>> |c1_val_1 | |c2_val_a1 |
>> |c1_val_2 | |c2_val_a2 |
>> |c1_val_3 | |c2_val_a3 |
>> +-----------+ +------------+
>>
>> 2. next, I select a value in combo2:
>>
>> combo1 combo2
>> +----------------+ +-----------------+
>> |*default_combo1 | |*c2_val_a2 |
>> +-----------+----+ +------------+----+
>> |c1_val_1 | |c2_val_a1 |
>> |c1_val_2 | |default_a_co|
>> |c1_val_3 | |c2_val_a3 |
>> +-----------+ +------------+
>>
>> Nothing else happens, and this is ok.
>>
>> 3. Now I select another value in combo1. At this point the content of
>> combo2 is completely replaced by other values. And I recognize that the
>> new default value is displayed. But the situation is as follows:
>>
>> => WRONG
>> combo1 combo2
>> +-----------------+ +-----------------+
>> |*c1_val_2 | |*default_a_combo2|
>> +-----------+-----+ +------------+----+
>> |c1_val_1 | |default_b_co|
>> |default_com| |c2_val_b2 |
>> |c1_val_3 | |c2_val_b3 |
>> +-----------+ |c2_val_b3 |
>> +------------+
>>
>> The value default_a_combo2 is displayed, but it is not an element of the
>> content of combo2. The question is, how can I get the combo2 so that it
>> displays after a change in combo1 the default value default_b_combo2 and
>> not the previously selected value?
>>
>> => INTENDED BEHAVIOUR:
>> combo1 combo2
>> +-----------------+ +-----------------+
>> |*c1_val_2 | |*default_b_combo2|
>> +-----------+-----+ +------------+----+
>> |c1_val_1 | |c2_val_b2 |
>> |default_com| |c2_val_b3 |
>> |c1_val_3 | |c2_val_b3 |
>> +-----------+ +------------+
>>
>> Does this clarify my intention?
>>
>> Regards,
>> Ralf.
>>
>>>
>>> R. Heydenreich wrote:
>>>> Rüdiger Herrmann schrieb:
>>>>> did you try
>>>>> myCombo2.setSelection( StructuredSelection.EMPTY );
>>>>> in the selectionChanged method?
>>>>>
>>>>> HTH
>>>>> Rüdiger
>>>> Hi Rüdiger,
>>>> this doesn't set the value, too. If I select any value in combo2 and
>>>> after this select a value in combo1, the combo2 doesn't refresh its
>>>> (displayed resp. selected) value. The values inside combo2 are
>>>> refreshed. Any further hints are welcome.
>>>>
>>>> Regards,
>>>> Ralf.
>>>>
>>>>> R. Heydenreich wrote:
>>>>>> Hi all,
>>>>>> I've created two Combos. If I change the selection in Combo1, the
>>>>>> value
>>>>>> of Combo2 should reset to default value. I got this as follows:
>>>>>>
>>>>>> myCombo1.addPostSelectionChangedListener(new
>>>>>> ISelectionChangedListener() {
>>>>>> public void selectionChanged(SelectionChangedEvent arg0) {
>>>>>> myCombo2.refresh(false);
>>>>>> myCombo2.getCombo().select(0);
>>>>>> }
>>>>>> });
>>>>>>
>>>>>> The value is set correctly to the first in the list, but the model
>>>>>> behind the combo2 doesn't recognize this change. How can I achieve
>>>>>> that
>>>>>> the model is updated, too?
>>>>>>
>>>>>> Thanks in advance,
>>>>>> Ralf.
Re: setting default value in Combo doesn't trigger an event [message #493987 is a reply to message #493658] Wed, 28 October 2009 16:26 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
setSelection( new StructuredSelection( *default_b_combo2 ) );

HTH
Rüdiger

R. Heydenreich wrote:
> Rüdiger Herrmann schrieb:
>> do you want to select an element in a combo viewer that is not part of
>> its content (i.e. is not returned by
>> IStructuredContentProvider#getElements)?
>> Is that what you want to achieve?
>
> No, I want only select the elements which are part of the list.
>
>>
>> R. Heydenreich wrote:
>>> Rüdiger Herrmann schrieb:
>>>> Ralf,
>>>>
>>>> I understood that you wanted to reset the selection of combo 2. This is
>>>> what "setSelection( StructuredSelection.EMPTY )" does.
>>>> If that's not what you wanted to do, then please clarify what you
>>>> actually want to achieve.
>>>>
>>>> Regards,
>>>> Rüdiger
>>> Hi Rüdiger,
>>> what I want to get is the following scenario:
>>> 1. (initial) both combos are filled with some values, and on both combos
>>> the first value is highlighted (here marked with an asterisk):
>>>
>>> combo1 (c1) combo2 (c2)
>>> +----------------+ +-----------------+
>>> |*default_combo1 | |*default_a_combo2|
>>> +-----------+----+ +------------+----+
>>> |c1_val_1 | |c2_val_a1 |
>>> |c1_val_2 | |c2_val_a2 |
>>> |c1_val_3 | |c2_val_a3 |
>>> +-----------+ +------------+
>>>
>>> 2. next, I select a value in combo2:
>>>
>>> combo1 combo2
>>> +----------------+ +-----------------+
>>> |*default_combo1 | |*c2_val_a2 |
>>> +-----------+----+ +------------+----+
>>> |c1_val_1 | |c2_val_a1 |
>>> |c1_val_2 | |default_a_co|
>>> |c1_val_3 | |c2_val_a3 |
>>> +-----------+ +------------+
>>>
>>> Nothing else happens, and this is ok.
>>>
>>> 3. Now I select another value in combo1. At this point the content of
>>> combo2 is completely replaced by other values. And I recognize that the
>>> new default value is displayed. But the situation is as follows:
>>>
>>> => WRONG
>>> combo1 combo2
>>> +-----------------+ +-----------------+
>>> |*c1_val_2 | |*default_a_combo2|
>>> +-----------+-----+ +------------+----+
>>> |c1_val_1 | |default_b_co|
>>> |default_com| |c2_val_b2 |
>>> |c1_val_3 | |c2_val_b3 |
>>> +-----------+ |c2_val_b3 |
>>> +------------+
>>>
>>> The value default_a_combo2 is displayed, but it is not an element of the
>>> content of combo2. The question is, how can I get the combo2 so that it
>>> displays after a change in combo1 the default value default_b_combo2 and
>>> not the previously selected value?
>>>
>>> => INTENDED BEHAVIOUR:
>>> combo1 combo2
>>> +-----------------+ +-----------------+
>>> |*c1_val_2 | |*default_b_combo2|
>>> +-----------+-----+ +------------+----+
>>> |c1_val_1 | |c2_val_b2 |
>>> |default_com| |c2_val_b3 |
>>> |c1_val_3 | |c2_val_b3 |
>>> +-----------+ +------------+
>>>
>>> Does this clarify my intention?
>>>
>>> Regards,
>>> Ralf.
>>>
>>>> R. Heydenreich wrote:
>>>>> Rüdiger Herrmann schrieb:
>>>>>> did you try
>>>>>> myCombo2.setSelection( StructuredSelection.EMPTY );
>>>>>> in the selectionChanged method?
>>>>>>
>>>>>> HTH
>>>>>> Rüdiger
>>>>> Hi Rüdiger,
>>>>> this doesn't set the value, too. If I select any value in combo2 and
>>>>> after this select a value in combo1, the combo2 doesn't refresh its
>>>>> (displayed resp. selected) value. The values inside combo2 are
>>>>> refreshed. Any further hints are welcome.
>>>>>
>>>>> Regards,
>>>>> Ralf.
>>>>>
>>>>>> R. Heydenreich wrote:
>>>>>>> Hi all,
>>>>>>> I've created two Combos. If I change the selection in Combo1, the
>>>>>>> value
>>>>>>> of Combo2 should reset to default value. I got this as follows:
>>>>>>>
>>>>>>> myCombo1.addPostSelectionChangedListener(new
>>>>>>> ISelectionChangedListener() {
>>>>>>> public void selectionChanged(SelectionChangedEvent arg0) {
>>>>>>> myCombo2.refresh(false);
>>>>>>> myCombo2.getCombo().select(0);
>>>>>>> }
>>>>>>> });
>>>>>>>
>>>>>>> The value is set correctly to the first in the list, but the model
>>>>>>> behind the combo2 doesn't recognize this change. How can I achieve
>>>>>>> that
>>>>>>> the model is updated, too?
>>>>>>>
>>>>>>> Thanks in advance,
>>>>>>> Ralf.
Re: setting default value in Combo doesn't trigger an event [message #494310 is a reply to message #493987] Fri, 30 October 2009 08:26 Go to previous message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
Rüdiger Herrmann schrieb:
> setSelection( new StructuredSelection( *default_b_combo2 ) );

Ah, many thanks. This was the missing line!

Greetings,
Ralf.


>
> HTH
> Rüdiger
>
> R. Heydenreich wrote:
>> Rüdiger Herrmann schrieb:
>>> do you want to select an element in a combo viewer that is not part
>>> of its content (i.e. is not returned by
>>> IStructuredContentProvider#getElements)?
>>> Is that what you want to achieve?
>>
>> No, I want only select the elements which are part of the list.
>>
>>>
>>> R. Heydenreich wrote:
>>>> Rüdiger Herrmann schrieb:
>>>>> Ralf,
>>>>>
>>>>> I understood that you wanted to reset the selection of combo 2.
>>>>> This is
>>>>> what "setSelection( StructuredSelection.EMPTY )" does.
>>>>> If that's not what you wanted to do, then please clarify what you
>>>>> actually want to achieve.
>>>>>
>>>>> Regards,
>>>>> Rüdiger
>>>> Hi Rüdiger,
>>>> what I want to get is the following scenario:
>>>> 1. (initial) both combos are filled with some values, and on both
>>>> combos
>>>> the first value is highlighted (here marked with an asterisk):
>>>>
>>>> combo1 (c1) combo2 (c2)
>>>> +----------------+ +-----------------+
>>>> |*default_combo1 | |*default_a_combo2|
>>>> +-----------+----+ +------------+----+
>>>> |c1_val_1 | |c2_val_a1 |
>>>> |c1_val_2 | |c2_val_a2 |
>>>> |c1_val_3 | |c2_val_a3 |
>>>> +-----------+ +------------+
>>>>
>>>> 2. next, I select a value in combo2:
>>>>
>>>> combo1 combo2
>>>> +----------------+ +-----------------+
>>>> |*default_combo1 | |*c2_val_a2 |
>>>> +-----------+----+ +------------+----+
>>>> |c1_val_1 | |c2_val_a1 |
>>>> |c1_val_2 | |default_a_co|
>>>> |c1_val_3 | |c2_val_a3 |
>>>> +-----------+ +------------+
>>>>
>>>> Nothing else happens, and this is ok.
>>>>
>>>> 3. Now I select another value in combo1. At this point the content of
>>>> combo2 is completely replaced by other values. And I recognize that the
>>>> new default value is displayed. But the situation is as follows:
>>>>
>>>> => WRONG
>>>> combo1 combo2
>>>> +-----------------+ +-----------------+
>>>> |*c1_val_2 | |*default_a_combo2|
>>>> +-----------+-----+ +------------+----+
>>>> |c1_val_1 | |default_b_co|
>>>> |default_com| |c2_val_b2 |
>>>> |c1_val_3 | |c2_val_b3 |
>>>> +-----------+ |c2_val_b3 |
>>>> +------------+
>>>>
>>>> The value default_a_combo2 is displayed, but it is not an element of
>>>> the
>>>> content of combo2. The question is, how can I get the combo2 so that it
>>>> displays after a change in combo1 the default value default_b_combo2
>>>> and
>>>> not the previously selected value?
>>>>
>>>> => INTENDED BEHAVIOUR:
>>>> combo1 combo2
>>>> +-----------------+ +-----------------+
>>>> |*c1_val_2 | |*default_b_combo2|
>>>> +-----------+-----+ +------------+----+
>>>> |c1_val_1 | |c2_val_b2 |
>>>> |default_com| |c2_val_b3 |
>>>> |c1_val_3 | |c2_val_b3 |
>>>> +-----------+ +------------+
>>>>
>>>> Does this clarify my intention?
>>>>
>>>> Regards,
>>>> Ralf.
>>>>
>>>>> R. Heydenreich wrote:
>>>>>> Rüdiger Herrmann schrieb:
>>>>>>> did you try
>>>>>>> myCombo2.setSelection( StructuredSelection.EMPTY );
>>>>>>> in the selectionChanged method?
>>>>>>>
>>>>>>> HTH
>>>>>>> Rüdiger
>>>>>> Hi Rüdiger,
>>>>>> this doesn't set the value, too. If I select any value in combo2 and
>>>>>> after this select a value in combo1, the combo2 doesn't refresh its
>>>>>> (displayed resp. selected) value. The values inside combo2 are
>>>>>> refreshed. Any further hints are welcome.
>>>>>>
>>>>>> Regards,
>>>>>> Ralf.
>>>>>>
>>>>>>> R. Heydenreich wrote:
>>>>>>>> Hi all,
>>>>>>>> I've created two Combos. If I change the selection in Combo1, the
>>>>>>>> value
>>>>>>>> of Combo2 should reset to default value. I got this as follows:
>>>>>>>>
>>>>>>>> myCombo1.addPostSelectionChangedListener(new
>>>>>>>> ISelectionChangedListener() {
>>>>>>>> public void selectionChanged(SelectionChangedEvent arg0) {
>>>>>>>> myCombo2.refresh(false);
>>>>>>>> myCombo2.getCombo().select(0);
>>>>>>>> }
>>>>>>>> });
>>>>>>>>
>>>>>>>> The value is set correctly to the first in the list, but the model
>>>>>>>> behind the combo2 doesn't recognize this change. How can I achieve
>>>>>>>> that
>>>>>>>> the model is updated, too?
>>>>>>>>
>>>>>>>> Thanks in advance,
>>>>>>>> Ralf.
Previous Topic:"Index out of bounds" when closing a tab in CTabFolder
Next Topic:deploying rap in tomcat: bundle not found and missing constraint
Goto Forum:
  


Current Time: Fri Apr 26 15:26:14 GMT 2024

Powered by FUDForum. Page generated in 0.23805 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top