I want to read the content of the dataprovider when contextMenu 
appear.

I get the information about the link (URL to open) on mouse click 
like below, to open the link in external browser window.

//When user clicks link, pass execution to JavaScript function on 
hosting page.
        linkbar.addEventListener(ItemClickEvent.ITEM_CLICK, function
(event:ItemClickEvent):void{
                var prod:Product = event.item as Product;
                
                if (prod != null && ExternalInterface.available) {
                        ExternalInterface.call
("launchExternalProduct", prod.id, prod.ssoEntryUri);
                }
    });


prod.id is the name of the product and prod.ssoEntryUri is the 
product URL.


How do I get the same information on ContextMenu (Right Click). My 
linkbar and buttons are created like this

private function initLinkBar(): void
{
    var linkbar:LinkBar = new LinkBar();
        linkbar.dataProvider = this.externalProducts.toArray();
        linkbar.id ="testlink";

linkbar.addEventListener(ItemClickEvent.ITEM_CLICK, function
(event:ItemClickEvent):void{
                var prod:Product = event.item as Product;
                
                if (prod != null && ExternalInterface.available) {
                        ExternalInterface.call
("launchExternalProduct", prod.id, prod.ssoEntryUri);
                }
    });
    
         
            
    cb.height =40;
    cb.addChild(linkbar);
}




Thanks
VN
    




On May 16, 9:55 pm, smalik <[EMAIL PROTECTED]> wrote:
> It works.
> 
> See the below code:
-






-- In [email protected], "the_braniak" <[EMAIL PROTECTED]> 
wrote:
>
> I'm not sure what link are you trying to open in a browser window.
> Where do you have the link (URL) you want to open stored?
> 
> Claudiu 
> 
> --- In [email protected], "vkc_nair" <vkc_nair@> wrote:
> >
> > Hi All, 
> > 
> > How to get the data behind a LinkBar item (e.g URL) on right 
mouse 
> > click? 
> > 
> > 
> > I have a LinkBar with 4 different items and a ContextMenu 
attached 
> > to 
> > the LinkBar. 
> > 
> > 
> > When user right click on each link the contextmenu give the 
option 
> > to 
> > open the link  in a Tab or an external Browser window. 
> > 
> > 
> > I want to pass the URL behind each link item programmatically to 
my 
> > contextmenu. 
> > 
> > 
> > Thanks 
> > VN
> >
>


Reply via email to