Select to view content in your preferred language

duplicate tabs dynamically?

850
5
Jump to solution
03-03-2014 08:00 PM
LefterisKoumis
Frequent Contributor
I don???t if it is possible, but I will ask anyway. I hope it makes sense what it follows???

I am using the tabbar and viewstack to create tabs for different layers. The first tab will be created initially and the others will be created dynamically.

The first tab will host a datagrid with the attributes for one layer. Also some mouse event actions will be present to provide user experience when they browse over the datagrid.

Here is the question. When the second tab is dynamically created, can a datagrid be placed and with the functions that are under the first tab to be under the second tab as well (for example the mouse events) so the user experience will be the same.

So, essentially it is more like a template to be adapted for each tab.

Your thoughts?

Thanks.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor
Lefteris,

I was able to dynamically create tabs that contain DataGrids. These grids contain the results of a IndentifyTask for each visible layer in a map. As each tab was added, an event listener was added for such events as ListEvent.ITEM_CLICK, ListEvent.ITEM_ROLL_OUT, etc. These listeners pointed to the same functions so that when the user did something like click on a row in a grid, it would highlight the feature on the map for that individual layer.

I put the code in a thread in GIS.StackExhange here. Unfortunately, the link to the working example is no longer valid, since the project was ported over to JavaScript.

View solution in original post

0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus
Lefteris,

   Sure if you do not make any of those functions specific to the template tab or datagrid. So if your rollover event use the function event like event.target as DataGrid instead of hard coding the datagrid to a specific id. You can have all your tabs using the same couple of functions.
0 Kudos
LefterisKoumis
Frequent Contributor
Lefteris,

   Sure if you do not make any of those functions specific to the template tab or datagrid. So if you rollover event use the function event like event.target as DataGrid instead of hard coding the datagrid to a specific id. You can have all your tab using the same couple of functions.


Thank you Robert. I thought the  creationpolicy could be my answer, but I totally misunderstood it, since it just instantiates existing hard coded objects.
0 Kudos
KenBuja
MVP Esteemed Contributor
Lefteris,

I was able to dynamically create tabs that contain DataGrids. These grids contain the results of a IndentifyTask for each visible layer in a map. As each tab was added, an event listener was added for such events as ListEvent.ITEM_CLICK, ListEvent.ITEM_ROLL_OUT, etc. These listeners pointed to the same functions so that when the user did something like click on a row in a grid, it would highlight the feature on the map for that individual layer.

I put the code in a thread in GIS.StackExhange here. Unfortunately, the link to the working example is no longer valid, since the project was ported over to JavaScript.
0 Kudos
LefterisKoumis
Frequent Contributor
Lefteris,

I was able to dynamically create tabs that contain DataGrids. These grids contain the results of a IndentifyTask for each visible layer in a map. As each tab was added, an event listener was added for such events as ListEvent.ITEM_CLICK, ListEvent.ITEM_ROLL_OUT, etc. These listeners pointed to the same functions so that when the user did something like click on a row in a grid, it would highlight the feature on the map for that individual layer.

I put the code in a thread in GIS.StackExhange here. Unfortunately, the link to the working example is no longer valid, since the project was ported over to JavaScript.


Thank you Ken. That was very helpful. Do you have by any chance the myInfoRenderer scipt? I just wanted to see how you structure the infowindow. Thank you.
0 Kudos
KenBuja
MVP Esteemed Contributor
It's just an empty canvas
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="410" height="240">
    
</mx:Canvas>
0 Kudos