Menu

Pop up under onNavigate

2007-03-07
2013-03-22
  • Nobody/Anonymous

    Dear all

    Maybe here is not suitable place to post this question but I really cannot find a solution about this. Is any way to popup a windows with certain tapestry page or URL under onNavigate? I can redirect the page with cycle.activate & URL with RedirectException but cannot find a good solution for popup. Please comment, thanks.

    regards

    wayne

     
    • perseios

      perseios - 2007-03-07

      This doesn't answer your question, but did you try to use the NewWindowLink_Tap4 component (at tassel) to render the links you want to be shown in a new window?

      Of course that works only with the Java-modelled version

       
    • Nobody/Anonymous

      Thanks for your reply. Maybe I missed some key point. From Tap4, contrib:PopupLink can do pop up and we can redirect to some page or URL later on. (but a component needed) At onNavigate, we receive the id click and preform further action under Java coding. I wonder how to link with the component within Java coding. I tried to link them up with something like http://localhost:8080/proj/app?component=_popup_Page&page=Home&service=direct but exception generated (seems listener missing). Any hints would be appreciate, thanks.

      regards

      wayne

       
    • perseios

      perseios - 2007-03-07

      I can't see contrib:PopupLink in the Tapestry documentation. This was Tapestry 3, wasn't it?
      Anyway must be the same stuff as NewWindowLink_Tap4.

      To make a popup link, a redirect is not a good strategy, since javascript openWindow(..) usually is blocked by the browser's default options.
      A Popup Window must be opened by JavaScript on the browser when the user clicks the link. Not at the time, the browser receives the response.
      The onNavigate method just affects the server's response. If that response is shown in a new window or in the same window
      is defined at click-time on the browser.

      I tried out pop up links with the NewWindowLink_Tap4 component inside the menu.
      It works fine, but you have to nest the component in a span tag. This has the little drawback, that only the central field of the item
      is click-sensitive, but it works well.

      Render your items you want to open in a new window like this

      <span jwcid="@menu:JSCookMenu" source="ognl:menuModel"
             value="ognl:menuItem" theme=".." >
         <span jwcid="contentRenderer@Any">
             <a href="#" jwcid="@popup:NewWindowLink"
                listener="listener:onNavigate" parameters="ognl:menuItem.value" >
                <span jwcid="@Insert" value="ognl:menuItem.value" />
             </a>
         </span>
      </span>

      popup:NewWindowlink is the component from the NewWindowLink_Tap4 library.

      If contrib:PopUpLink really exists for Tap4, sure you can use it in a very similar way.

      cheers
      Burkhard

       
    • Nobody/Anonymous

      Thanks, using NewWindowLink and resulted disirable outcome. Found that related coding update at CVS also ,thanks a lot.

       

Log in to post a comment.