pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: Dynamic menu buttons
Date Fri, 09 Apr 2010 19:08:30 GMT
Your example translates roughly to the following in Java:

MenuButton menuButton = new MenuButton();

Menu menu = new Menu();
menuButton.setMenu(menu);

Menu.Section menuSection = new Menu.Section();
menu.getSections().add(menuSection);

Menu.Item menuItem = new Menu.Item();
menuSection.add(menuItem);
menuItem.setButtonData("XXXX");
menuItem.setAction("myaction");

So, you can basically duplicate the last section to dynamically add items to the menu section.

In case you are not familiar with it, you can give the <Menu.Section> element an ID
and map it into your Java code using the @WTKX annotation. That way, you don't need to create
the menu section in code - you can still declare it in your WTKX.


On Apr 9, 2010, at 2:59 PM, Shahzad Bhatti wrote:

> I need to create menu buttons that I can populate dynamically. How would I change menu
buttons from static definition such as:
>                        <MenuButton>
>                            <menu>
>                                <Menu>
>                                    <sections>
>                                        <Menu.Section>
>                                            <Menu.Item buttonData="XXXX" action="myaction"/>
>                                        </Menu.Section>
>                                    </sections>
>                                </Menu>
>                            </menu>
>                        </MenuButton>
> 
> 
> so that I can add start with empty Menu.Section and add Menu.Item programmatically. Thanks.
> 
> 
> ______________________________________________
> 
> See  http://www.peak6.com/email_disclaimer.php
> for terms and conditions related to this email


Mime
View raw message