0

I am using Mdirtyable in my code. I want that when user chose a different radiobutton, the part will be dirty(*). There is a group of radiobutton on a part in my design. One of the radiobutton is default selected. The problem is that when the code runned, the part open as dirty. But I want that the part open as undirty and if the user chose a different radiobutton, the part will be dirty.

I'm using selectionListener for this. My example code part is below:

radioButton.addSelectionListener(new SelectionAdapter()
{
  public void widgetSelected(SelectionEvent e)
  {                    
    mdirtyable.setDirty(true);
  }
 }

Thank you,

eponymous
  • 2,090
  • 5
  • 23
  • 29

1 Answers1

2

Don't add the selection listener to the buttons until after you have set the initial default value. Or have a flag to say that you don't want the dirty to be set yet.

greg-449
  • 109,219
  • 232
  • 102
  • 145