0 Replies Latest reply on May 26, 2011 3:52 AM by Immo Benjes

    Loading page in new window with s:link

    Immo Benjes Newbie


      I am trying to have links to some 'entity view' pages which are opened in a new window when the user clicks on a link. I know I could simply provide the ID of the entity as a parameter but I've read somewhere that that would be a security risk (? I found that strange as RESTful webservices work exactly like that). Anyway, I try to do it differently by initializing a EntityHome instance in the background before opening the new window.

      The code in the JSF page is

      <s:link target="_blank" view="/secure/DocsViewEntity.xhtml" value="#{entity.name}">
          <a:support event="onclick" action="#{pageLinker.viewEntity(entity)}"/>

      In the backing bean pageLinker I initialize a EntityHome intstance for that entity (in a long running conversation) and then I have naviation rules in pages.xml to redirect (not sure whether it is really needed when I have the view in s:link).

      Anyway that all works fine, a new window is opened and the DocsViewEntity page is shown, however it is shown for an empty entity (nothing set). At first I thought okay the conversation of the EntityHome was ended already and a new EntityHome was created but when I reload the page with the browser the DocsViewEntity page is showing the correct entity.

      So it seems the EntityHome is initialized after the page has been loaded. How can I achieve that it is initialized before the new page is rendered?

      Thanks for your help