MenuBar: How to add items to the collection through actionscript arrayCollection?

I want to use a menu to my application menu bar.  I have a list of menu items I want to implement for the menu bar, but I need to configure them using actionscript so I can use conditional statements for menu items to be added depending on the access level of the user.

Here is the generic view of what I want

< script >

mBarAC.addItem ({label: "1", data: "Label1"});

mBarAC.addItem({label:"Label2",data:"Label2"});)

If (userObj.access == 'admin') {}

mBarAC.addItem ({label: "3", data: "Label3"});

}

< / script

< mx:MenuBar id = "mBar" dataProvider = "{mBarAC}" labelField="@label"/ >

But this translates [object Object] for each menu item.  So, how can I fix this so that it displays the labels I want?

I think that the wording field should simply be 'label' rather than '@label '. The @ symbol is only required during parsing of an attribute in an XML node.

Tags: Flex

Similar Questions

  • How to add items to the repository. ?

    HII,

    I want to add the data user such as name, age, etc. in the repository.

    I created a custom repository, the database table and it mapped by the descriptor to point.

    But how to use the MutableRepository Interface or RepositoryFormHandler to add items to the table...?

    Thanks in advance

    Aurélien

    Try this:

    MutableRepository PSMS = (MutableRepository)request.resolveName("/com/FirstRepository");

    MutableRepositoryItem repItem = mRep.createItem ("user");

    repItem.setPropertyValue ("name", "Suprême");

    repItem.setPropertyValue ("age", 40);

    mRep.addItem (repItem);

    Peace

    Shaik

  • How to add items to the list of object field

    I have an array of strings as shown below.

    String s [] = {'a', 'b', 'b', 'b', 'b', 'b', "a"};

    I want these elements in the field of the Objecat list with output picking up the elements of a String array.

    in other words, the ListField should only contains ' has 'and' b ' as list items

    How to add the elements of a String array to the listfiled without repeating the

    Chain of elements of the array.

    someone help me please...

    concerning

    use a vector as the data structure for the objectlistfield. Check contains() before adding the item in the vector.

  • How to add items to the table

    Hello:

    I have a general question about powerCLI: How can I create table and add the object to this table later?

    Basically, I select all virtual machines, check something on them using "foreach" and "" matches a condition later with what I need I want to put it (vm) to the specific table ($vms) that I'll use later.

    How can I do?

    Thank you very much!

    Hello, qwert1235-

    You can use something like the following:

    ## initialize a new array$arrVMs = @()Get-VM | %{    ## if the VM is config'd with more than 4GB mem, add it to the array    if ($_.MemoryMB -gt 4096) {$arrVMs += $_}} ## end foreach-object
    

    But, really, you should be able to avoid the extra code and just do a table of elements you want from the outset, as:

    ## make an array of VMs config'd w/ more than 4GB mem$arrVMs = Get-VM | ?{$_.MemoryMB -gt 4096}
    

    There are times, however, when adding a table would be necessary.  The first example would do exactly that.

  • How to add items to the windows media player library?

    I am entered in the Windows Media Player, the library, drive and checked "Add media to library when played," then play the music on my computer, but it did not work, it does not add to the library.  Please tell me how to do step by step.

    Thank you!

    I just record my music in the music folder.

    Perhaps the following goods range offers a few ideas:

    Windows Vista - works with the music folder
    http://Windows.Microsoft.com/en-us/Windows-Vista/working-with-the-music-folder

    Windows Vista - put on the road with Windows Media Player
    http://Windows.Microsoft.com/en-us/Windows-Vista/getting-started-with-Windows-Media-Player

    The following article was written for Windnws XP
    Windows Media Player 11 that it can also be useful for Vista:

    Windows XP - organize and search your digital media collection
    http://Windows.Microsoft.com/en-us/Windows-XP/help/Windows-Media-Player/11/library

  • How to add items to the inventory within a workflow

    Hello!

    All new Plugins (SNMP, SOAP, REST,...) allow the addition of new server connections in a flow of installation work (rather than the way inherited via the configuration tool).

    How can I implement this in my own custom plugin?

    Kind regards

    Joerg

    Hi Joerg,

    I guess that you may have about the ways to store configuration data in vCO.

    The closest to the traditional approach is to use the configuration file which is also used from the configurator.

    In Java, you can get the correct path of context by using the SDKHelper, for example like this:

    String path = SDKHelper.getConfigurationPathForPluginName (PLUGIN_NAME);

    Then you serialize your objects of configuration in XML in this file.

    Alternatively, you can use resources to store data of configuration programmatically. This could facilitate the storage and Exchange configurations, but make sure not to put any sensitive data, as resource items are clearly visible in vCO.

    Best regards

    Ivan

  • ComboBox, how to add items to the table?

    Hello

    I have two tables with elements (names and age), and I want to add elements of 'names' in the drop-down list area using for loop and add the age to enter text using if statement, for example:

    If (names [i] is .x)

    mytextBox = age [i];

    I added "combobox" to my pdf and the name of the game "mycombo", and now I want to add any element

    How can I do this with Java Script on Acrobat?

    var i = 0;

    for (i = 0; i < names.length; i ++) {}

    mycombo.setItem = names [i];

    }

    No variable is global, unless you set it as one. Look at the global object

    in the reference files.

  • How to add items to the Windows Explorer right-click menu drop-down?

    Sometimes it would be nice to be able to add a shortcut to a program that shows when you right click on a file in Windows Explorer.  Is it possible manually?  And can we remove others that we never use as well by the same method?

    You can, to a limited extent.  And it's the registry changes, so I would recommend caution.  There are also a few small programs that change the menu.

    http://vlaurie.com/right-click/Customize-context-menu.html

    A simple way, I used is to create shortcuts custom in the SendTo context menu folder.  With which you can perform most any function, such as send a text file to open with MS Word or send any type of image to open it with any number of image viewers.

    You can access the SendTo file by entering shell: sendto in the navigation bar of the Explorer, or simply run and the shell: sendto

  • OID: How to add users to the group through LDIF

    How am I suppose to assign users a group? It seems that, under the present:


    DN: cn = < role name >, cn = < domain >, groups
    objectClass: top
    objectClass: groupOfUniqueNames
    objectClass: orclGroup
    DisplayName: role
    Description: role for this user
    uniqueMember: < full DN >
    CN: < role_name >


    According to this example, when I add a group, I can specify a uniquemember, a user. Am I suppose to do?

    DN: cn = < role name >, cn = < domain >, groups
    objectClass: top
    objectClass: groupOfUniqueNames
    objectClass: orclGroup
    DisplayName: role
    Description: role for this user
    uniqueMember: < full DN for user 1 >
    uniqueMember: < full DN for user 2 >
    uniqueMember: < full DN for the user 3 >
    uniqueMember: < full... the DN of the user >
    CN: < role_name >

    The example that you mentioned will create a new group with users uniquemember as members of this group

    While it will be assign uses uniquemember to an existing group.

    DN:CN =, cn = groups,
    ChangeType: modify
    Add: uniquemember
    uniqueMember:
    ...

    Hope this helps,
    Sagar

  • How can I add items to the Menu of the button lock, I don't, change user, close and lock. I want to add 'restart '.

    How can I add items to the Menu of the button lock, I don't, change user, close and lock. I want to add 'restart '.

    How can I add items to the Menu of the button lock, I don't, change user, close and lock. I want to add 'restart '.

    This tutorial should do what you want. Use method 2.
    http://www.Vistax64.com/tutorials/105003-shutdown-options-start-menu.html

    Please read all notes caefully, not only the parts of the statement.

    t-4-2

  • Add items to the combo box when running

    In my program, I want to add int '34' "43", "17"... and let the user choose one of them to the drop-down list box. How can I add items to the combo box when running. Create a property node 'String [] '? I try that, but its screen is "3443". I want to display as "34".

    43

    17

    See attached extract

  • How to add programs to the start of the file using Vista

    How to add programs to the start of the file using Vista

    Hi Harry,.

    Oddly enough, you can actually do it in msconfig except if it is already there and simply not checked as opposed to not being do not at all (although you would think that they would understand this option).

    The easiest way is to add the program (or a shortcut to the program) in the folder all Menu Programs Startup.   Here is the procedure: http://www.ehow.com/how_5098465_add-startup-programs.html.  Remember, to do this, you must either a shortcut existing (perhaps on the desktop or elsewhere in the menu all programs) or you need to find the source file (probably somewhere in C:\Program Files depending on what you want to add) and either copy it and add it to the startup folder or right-click on it and create a shortcut to copy into the startup folder.  Once you reboot, this program starts during the initial commissioning process and you will now be able to control using msconfig.exe, if you wish.

    Another option is to do this by using the registry editor.  If you decide to try this, first create a restore AND system restoration point backup of the registry before you begin.  Here is the procedure: http://www.ehow.com/how_7304438_add-program-msconfig-regedit.html.  I recommend to use this ONLY if the previous procedure does not work for some reason any as long as that the procedure is simpler and safer.

    If you want a simpler way to manage and control startup programs, you can try it free WinPatrol http://www.winpatrol.com/download.html that change monitors for startup programs if you set it to run in real-time so that you know when to try new programs are added to your Start menu and, for the purposes of this question includes an Add button which opens a link to a window of Windows Explorer where you can browse the program you want to add, click open to select and then add it directly to the commissioning.  If you prefer it does not work all the time, you can simply uncheck the box which includes this program and it will work only when you choose to run (but at the start, will work as an indication otherwise or configured).  It will appear not in the start menu in all programs (Finally, WinPatrol is, but not programs, it adds to the start), but it will appear in WinPatrol (which also lets you manage what you want or not start with checkboxes as in msconfig) and sure in msconfig - but only after a reboot is complete the process of adding.

    I hope this helps.  Personally, I use WinPatrol myself and let it run in real time.  Since I do a lot of installations, it helped me often prevent the addition of a startup item I haven't really need and reduces how many times I actually need to check what is happening out there.

    If this answers your question without the need to repost in another forum, please mark it as an answer.  If this isn't the case, then of course you must republish as suggested above.

    Good luck!

  • How to add text to the Notes?

    Hi all

    I want to add some text in the notes. I create notes with success.

    My note label and name are not apply any script executed successfully.

    How to add text to the note? My script is:

    indesign #target

    myDocument var = app.documents.add ();

    var myTextFrame = myDocument.pages.item (0).textFrames.add ();

    myTextFrame.geometricBounds is ['10', 15 ' p', '50 p', '50 p'];.

    myTextFrame.contents = "Adobe Indesign";

    var insertionPoint = myTextFrame.insertionPoints.item (-1);

    var note = insertionPoint.notes.add (1433299822);

    Note.label = "NewNote";

    Note. Name = "FirstNote";

    Thank you

    Jin

    try sth. like

    Note.texts [0] .silence = 'some content '.

    Hans-Gerd Classen'

  • How to add bookmarks to the IE Favorites list?

    How to add bookmarks to the IE Favorites list? I can find them on recently added bookmarks, but they are not listed when I click on IE Favorites.

    Firefox bookmarks are stored in your Firefox profile folder, they are not synchronized with the IE Favorites.

  • I disabled the toolbar &gt; &gt; Menu button (via a right click on a PC, Windows 7) and cannot access the toolbar to add items to the sail back in. Any ideas?

    I disabled the toolbar > > Menu button (via a right click on a PC, Windows 7) and cannot access the toolbar to add items to the sail back in. Any ideas?

    Don't see the menu bar not (File, Edit, View, history, Favorites, tools, help)?
    Turn on/off the menu bar is a new feature in version 3.6.
    (Linux and OSX see: what happened to the file, edit and view menus? )
    Windows Method 1. Press and hold the key and press the letters of the following in this exact order: V T M
    Windows method 2 Press and release the button. The Menu bar is displayed; then choose ~ ~ red: V ~ ~ iew > ~ ~ red: T ~ ~ oolbars and click on ~ ~ Red: M ~ ~ enu Bar.
    The menu bar should now be displayed permanently, unless you turn it off again using view > toolbars. Check = not displayed, NO check mark is not displayed.
    See: http://support.mozilla.com/en-US/kb/Menu+bar+is+missing

    Navigation, bar toolbar bookmarks and other toolbars under view > toolbars. By clicking on one of them will place a check mark (display) or remove the check mark (not shown).

    To display the status bar, view, and then click status bar to place a check mark (display) or remove the check mark (not shown).

    Mode full screen
    http://KB.mozillazine.org/netbooks#Full_screen

    See also:
    Back and front toolbar buttons or others are missing
    Customize controls, buttons, and Firefox toolbars

Maybe you are looking for

  • Opening software - how to reinstall

    Hello I had the Aperture software with my iMac. Recently, I had to format my HARD drive and lost the opening. How to download the opening of the Appstore? Do not listed. Also, since I got it in the box version, I do not seem to have the serial number

  • Problem with auto-scroll.

    (Sorry for my bad English, it is not my native language)Hello, it's been several months I have a problem with Firefox auto-scrollKeep the pressure on the mouse wheel can slide in all directions of the web page, very useful for long pages as well as f

  • 37 of Firefox on Ubuntu 14.10 cannot use Media Source Extensions on YouTube

    I've seen on the issue date that Media Source Extensions has been activated for YouTube with this version. I was wrong?

  • Compaq 610: Win 8.1 drivers?

    Hello There the official drivers for Windows 8.1/8 for Compaq 610? Thank you Constantine.

  • PC Companion - Outlook synchronization fails with an unknown error

    try a synchronization with outlook 2010 led to a unknown error, reading the newspaper: 09:18:29, 37 [PCCompanion] 09/14/11 activate CalendarManager09:18:45, 15 [MapiThk] 05/13/06 Outlook 2010 detected.09:18:45, 15 [Syncengine] 13/05/22 PIM Get databa