Announcement Announcement Module
Collapse
No announcement yet.
Attempt to mutate in notification Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Attempt to mutate in notification

    Hi *

    I have the following exception...

    I have a PropertyChangeListener on a ValueModel for property1.
    In that listener, I detect that the value for property1 is not acceptable and I decide to change it to the limit by calling:
    Code:
    getValueModel("quantity").setValue(maxValue);
    And bang... I have the exception below..

    So my question is really what is the recommended way to implement a 'vetoable' mechanism for property change? Or what would be the quick fix to allow the listener to change the value of the model property it is listening on...

    Many thanks!

    Benoit

    Code:
    java.lang.IllegalStateException: Attempt to mutate in notification
            at javax.swing.text.AbstractDocument.writeLock(AbstractDocument.java:1343)
            at javax.swing.text.AbstractDocument.replace(AbstractDocument.java:662)
            at javax.swing.text.JTextComponent.setText(JTextComponent.java:1441)
            at org.springframework.binding.value.swing.AsYouTypeTextComponentAdapter.valueModelValueChanged(AsYouTypeTextComponentAdapter.java:64)
            at org.springframework.binding.value.support.AbstractValueModelAdapter$ValueModelChangeHandler.propertyChange(AbstractValueModelAdapter.java:7
    5)
            at org.springframework.binding.value.support.AbstractValueModel.fireValueChangeEvent(AbstractValueModel.java:172)
            at org.springframework.binding.value.support.AbstractValueModel.fireValueChange(AbstractValueModel.java:144)
            at org.springframework.binding.value.support.ValueHolder.setValue(ValueHolder.java:60)
            at org.springframework.binding.value.support.AbstractValueModel.setValueSilently(AbstractValueModel.java:54)
            at org.springframework.binding.form.support.FormModelMediatingValueModel.setValueSilently(FormModelMediatingValueModel.java:69)
            at org.springframework.binding.value.support.AbstractValueModelWrapper.setValueSilently(AbstractValueModelWrapper.java:41)
            at org.springframework.binding.form.support.DefaultFormModel$ValidatingFormValueModel.setValueSilently(DefaultFormModel.java:343)
            at org.springframework.binding.value.support.AbstractValueModelWrapper.setValue(AbstractValueModelWrapper.java:37)
            at net.objectlab.xxxxxxxxForm$3.handleNewQty(LegDetailForm.java:130)
Working...
X