Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Roster question

Avatar

Level 3

I had asked this question before, but I was hoping that someone could assist me in adding the options menu to the Roster component. Is there any sample code available?

Thanks

Dominic

1 Accepted Solution

Avatar

Correct answer by
Level 2

  I had the same problem like you, but I managed to add the menu options to the Roster component.

1. Create a function addMenuOptions:

private function addMenuOptions( userDescriptor :UserDescriptor):Object

{

     var dp: ArrayCollection = new ArrayCollection() // you can chose your favorite type of dataProvider( XML, Array...)

     dp.addItem( {label: "Kick", data: 0});

     dp.addItem( {label: "Ban", data: 1});

     dp.addItem( {label: "Kick& Ban", data: 2});

     return dp;

}

2. Add the function to your Roster component ( menuDataProviderFunction="addMenuOptions").

3. Create a CSS file named main.css and create a style for CustomMenu;

     CustomMenu

     {

          borderColor: #FF0000; // add any color here and will work

     }

4. Add the css file in your main mxml, <mx:Style  source="main.css" />. If you don't create the "dummy" css file you will recieve an error when you try to click the menu.

This worked for me. If you have any questions be free to answer here.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 2

  I had the same problem like you, but I managed to add the menu options to the Roster component.

1. Create a function addMenuOptions:

private function addMenuOptions( userDescriptor :UserDescriptor):Object

{

     var dp: ArrayCollection = new ArrayCollection() // you can chose your favorite type of dataProvider( XML, Array...)

     dp.addItem( {label: "Kick", data: 0});

     dp.addItem( {label: "Ban", data: 1});

     dp.addItem( {label: "Kick& Ban", data: 2});

     return dp;

}

2. Add the function to your Roster component ( menuDataProviderFunction="addMenuOptions").

3. Create a CSS file named main.css and create a style for CustomMenu;

     CustomMenu

     {

          borderColor: #FF0000; // add any color here and will work

     }

4. Add the css file in your main mxml, <mx:Style  source="main.css" />. If you don't create the "dummy" css file you will recieve an error when you try to click the menu.

This worked for me. If you have any questions be free to answer here.