Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Get old value of radio button group after/while changing
Get old value of radio button group after/while changing [message #1269862] Wed, 12 March 2014 09:10 Go to next message
Thomas Schmelz is currently offline Thomas SchmelzFriend
Messages: 1
Registered: March 2014
Junior Member
Is there a Scout method (like execChangedValue()) in the AbstractRadioButtonGroup which presents the old selected value in the radio button group after/while changing the selected value?
Re: Get old value of radio button group after/while changing [message #1270035 is a reply to message #1269862] Wed, 12 March 2014 12:31 Go to previous messageGo to next message
Matthias Otterbach is currently offline Matthias OtterbachFriend
Messages: 9
Registered: June 2013
Junior Member
I don't think such a method exists. For other field types I have seen/used code similar to (untested code, just wrote it from scratch):

public class MyRadioButtonGroup extends AbstractRadioButtonGroup<Integer> {

  private Integer myOldValue;

  public class RadioButton1 extends AbstractRadioButton {
    @Override
    protected Object getConfiguredRadioValue() {
      return Integer.valueOf(1);
    }
  }

  public class RadioButton2 extends AbstractRadioButton {
    @Override
    protected Object getConfiguredRadioValue() {
      return Integer.valueOf(2);
    }
  }

  @Override
  protected void execChangedValue() throws ProcessingException {
    super.execChangedValue();

    if(myOldValue > getValue()) {
      // do something
    }

    // last line of code for this method
    myOldValue = getValue();
  }
}


If the button group has an initial value (or the value is changed by other methods) of course the variable myOldValue should also be set there.

[Updated on: Wed, 12 March 2014 12:32]

Report message to a moderator

Re: Get old value of radio button group after/while changing [message #1270073 is a reply to message #1269862] Wed, 12 March 2014 13:10 Go to previous message
João Rebelo is currently offline João RebeloFriend
Messages: 28
Registered: December 2013
Junior Member
AbstractRadioButtonGroup extends from AbstractValueField so you'll have access to all methods for value setting/validation.
As an example you might use execValidateValue to compare old value to the value being set
Previous Topic:SWT Rendering inner Group Box on a Custom Field
Next Topic:FileChooser in RAP
Goto Forum:
  


Current Time: Thu Mar 28 23:09:41 GMT 2024

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

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

Back to the top