Reset offerbook filter values at screen change (#235)

This commit is contained in:
Manfred Karrer 2014-10-27 02:22:41 +01:00
parent 27b47830b2
commit 670a19037e

View File

@ -124,7 +124,7 @@ public class OfferBookViewCB extends CachedViewCB<OfferBookPM> {
placeholder.setWrapText(true);
table.setPlaceholder(placeholder);
setupBindings();
setupValidators();
setupComparators();
@ -143,6 +143,12 @@ public class OfferBookViewCB extends CachedViewCB<OfferBookPM> {
public void activate() {
super.activate();
amountTextField.setText("");
priceTextField.setText("");
volumeTextField.setText("");
setupBindings();
// setOfferBookInfo has been called before
SortedList<OfferBookListItem> offerList = presentationModel.getOfferList();
table.setItems(offerList);
@ -157,6 +163,8 @@ public class OfferBookViewCB extends CachedViewCB<OfferBookPM> {
public void deactivate() {
super.deactivate();
removeBindings();
}
@SuppressWarnings("EmptyMethod")
@ -363,6 +371,20 @@ public class OfferBookViewCB extends CachedViewCB<OfferBookPM> {
presentationModel.fiatCode));
}
private void removeBindings() {
amountTextField.textProperty().unbind();
priceTextField.textProperty().unbind();
volumeTextField.textProperty().unbind();
amountBtcLabel.textProperty().unbind();
priceFiatLabel.textProperty().unbind();
volumeFiatLabel.textProperty().unbind();
priceDescriptionLabel.textProperty().unbind();
volumeDescriptionLabel.textProperty().unbind();
priceDescriptionLabel.textProperty().unbind();
volumeDescriptionLabel.textProperty().unbind();
volumeTextField.promptTextProperty().unbind();
}
private void setupValidators() {
amountTextField.setValidator(optionalBtcValidator);
priceTextField.setValidator(optionalFiatValidator);