title: Show alert() after executing managed bean action method
body: <p>I've a command link:</p>
  
  <pre><code>&lt;h:commandLink value="Delete"
      onclick="return confirm('Are you sure?');" 
      action="#{bean.deleteDestination(destination, '/destination/show')}" /&gt;
  </code></pre>
  
  <p>It invokes this managed bean action method:</p>
  
  <pre><code>public String deleteDestination(Destination selected, String action) {
      List&lt;Flight&gt; flights = getEjbFlightFacade().findFlightWithDestination(selected);
  
      if (flights.isEmpty()) {
          getEjbDestinationFacade().remove(selected);
          setDestinations(getEjbDestinationFacade().findAll());
      }
      else {
          // Here need to show an alert() that user can't remove the item.
      }
  
      return action;
  }
  </code></pre>
  
  <p>As indicated by the comment, I'd like to show an <code>alert()</code> that the enduser can't remove the item. How can I achieve that?</p>