mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-20 07:46:05 -04:00
Reset offerbook filter values at screen change (#235)
This commit is contained in:
parent
27b47830b2
commit
670a19037e
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user