title: Vaadin (Flow): Navigating to destination with a shared object
body: <h2>Problem:</h2>
  
  <p>I currently have a grid that displays content of type <code>SomeModel</code>.
  When I click an entry of that <code>Grid</code> I would like to navigate to a view that takes an object as its input to display the entries content.</p>
  
  <h2>Implementation:</h2>
  
  <p>To achive this behaviour I created a <code>DetailLayout</code> like this:</p>
  
  <pre><code>public DetailLayout extends FlexLayout implements HasUrlParameter&lt;SomeModel&gt;{
      /* skipped some details */
      @Override
      public void setParameter(BeforeEvent event, Host parameter) {
          /* This is where I expected to be able to handle the object */
      }
  }
  </code></pre>
  
  <p>From within the <code>Grid</code> I tried to navigate like this:</p>
  
  <pre><code>addSelectionListener((event) -&gt; {
      event.getFirstSelectedItem().ifPresent(somemodel -&gt; {
          getUI().ifPresent(ui -&gt; {
              ui.navigate(DetailLayout.class, somemodel);
          });
      });
  });
  </code></pre>
  
  <p>But unfortunately this behaviour is not supported by Vaadin even tho its syntax is perfectly fine.</p>
  
  <hr>
  
  <h2>Question:</h2>
  
  <p>Do you know of another way to pass an object while navigation or did I miss a certain part of the official documentation <a href="https://vaadin.com/docs/v12/flow/routing/tutorial-routing-annotation.html" rel="nofollow noreferrer">documentation</a> ?</p>
  
  <p>Thank you in advance</p>