title: Check multiple elements with a single listener
body: <p>I'm trying to create an email client. This is the output when I open the program:
  <a href="https://i.stack.imgur.com/vX7NI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vX7NI.png" alt="enter image description here"></a></p>
  
  <p>As you can see, the only button enabled is the <strong>Reply-All</strong> one. This is because I cannot forward or reply to an email not selected, but I can reply to all the emails in the list. Then, If I delete all the emails this is the output:
  <a href="https://i.stack.imgur.com/fr9pM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fr9pM.png" alt="enter image description here"></a></p>
  
  <p>All the buttons are disabled (and this is correct). Now, if I change account by pressing <strong>Cambia Account</strong> a new list of email will be generated, but the <strong>Reply-All</strong> button will not get enabled. I guess that this is because the listener only check the status of the current mail and not if there is a list of them. How can I solve it?
  <a href="https://i.stack.imgur.com/nSTQB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nSTQB.png" alt="enter image description here"></a></p>
  
  <p>This is the code which manage the part where I disable the buttons:</p>
  
  <pre><code>public void initModel(DataModel model) {
      if (this.model != null) {
          throw new IllegalStateException("Model can only be initialized once");
      }
      this.model = model;
      model.currentEmailProperty().addListener((obs, oldEmail, newEmail) -&gt; {
          if (oldEmail != null) {
              reply.setDisable(false);
              forward.setDisable(false);
              replyall.setDisable(true);
          }
          if (newEmail == null) {
              reply.setDisable(true);
              forward.setDisable(true);
              replyall.setDisable(true);
          } else {
              reply.setDisable(false);
              forward.setDisable(false);
              replyall.setDisable(false);
          }
      });
  }
  </code></pre>