1 Reply Latest reply on May 2, 2008 8:25 PM by vk101

    Injecting an entity after navigating to that entity's page

      If you have a session-scoped object like currently logged-in User that needs to add/remove other types of objects (like favourite colours), how would you ensure that colours are available to a JavaBean component that manages the addition/removal of these relationships?


      If every colour has its own page (colour.seam?id=1) how can you make sure that the colour is injected into the JavaBean component (e.g. favouriteColourManager's makeLink/breakLink methods) after the user has navigated to the page for the colour they want to add?


      (e.g. a user navigates to the page for the colour Red, clicks an 'Add Favourite Colour' link or button, then the favouriteColourManager JavaBean has access to the user and the colour Red and can set up the association)


      In pages.xml I've set it up in the following way, and I use framework:entity-home in pages.xml.


      <param name="id" value="#{colourHome.id}" converterId="javax.faces.Integer" />


      Do I need to kick off some kind of long-running conversation? (I hope not, because isn't this just a single-request thing?)


      How could I make this work?


      Thanks.