Select to view content in your preferred language

Flexviewer popup javascript window.open

966
3
Jump to solution
12-09-2012 04:15 PM
ArowanaIndah
Deactivated User
hi,
i'm using application builder. I'm trying to customize popup.xml where when i'm click the link, it will open new popup window like javascript window.open.  Is there any example that i can use it..

Thank
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Arowana,

  So hopefully you have done a little searching and are familiar with how to get the PopUpRendererSkin.mxml add to the viewer from the API download. So all you have to do is add these lines to the textFlow_linkClickHandler function:

            private function textFlow_linkClickHandler(event:FlowElementMouseEvent):void             {                 var linkElement:LinkElement = event.flowElement as LinkElement;                 if (linkElement && linkElement.target != "_blank")                 {                     linkElement.target = "_blank"; // make sure target is "_blank"                 }                                  event.stopImmediatePropagation();                 event.preventDefault();                 var feats:String = "scrollbars=1,width=250,height=450";                 ExternalInterface.call("window.open", linkElement.href, "_blank" , feats);             }


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow these steps as shown in the below graphic:

View solution in original post

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus
Arowana Indah,

   All links in popups open in a new window. Why are you wanting to use window.open?
0 Kudos
ArowanaIndah
Deactivated User
Hi Robert,

Thank for quick reply.

Actually i'm tring to make when the user click link in popup, it will open the new window with size example width=250 height=450.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Arowana,

  So hopefully you have done a little searching and are familiar with how to get the PopUpRendererSkin.mxml add to the viewer from the API download. So all you have to do is add these lines to the textFlow_linkClickHandler function:

            private function textFlow_linkClickHandler(event:FlowElementMouseEvent):void             {                 var linkElement:LinkElement = event.flowElement as LinkElement;                 if (linkElement && linkElement.target != "_blank")                 {                     linkElement.target = "_blank"; // make sure target is "_blank"                 }                                  event.stopImmediatePropagation();                 event.preventDefault();                 var feats:String = "scrollbars=1,width=250,height=450";                 ExternalInterface.call("window.open", linkElement.href, "_blank" , feats);             }


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow these steps as shown in the below graphic:

0 Kudos