if that doesnt work, here it is another way... again, i havent tried, im
just looking at the source code and the javadocs ^_^

BaseItem[] biMenu = menu.getItems();

for (int i = 0; i < biMenu.length; i++) {
     //get the config object, this menthod seams to be public.
    JavaScriptObject jsobj = biMenu.getOrCreateJsObj();
    //do the "cloning" and create an exact copy (i asume that all inner
values/properties are copied as well)
    Checktem menuItem = new CheckItem(jsobj);
}


Regards,
_____________________
Ing. Gabriel Gutiérrez



On Thu, May 28, 2009 at 11:53 AM, Gabriel Ernesto Gutierrez Añez <
[email protected]> wrote:

> try this
>
> BaseItem[] biMenu = menu.getItems();
>
> for (int i = 0; i < biMenu.length; i++) {
>     CheckMenuItem menuItem = (CheckMenuItem
> )menu.getItem(biMenu[i].getId());
> }
>
> PD: I dont know if this will return a BaseItem like getItems().
>
> Regards,
> _____________________
> Ing. Gabriel Gutiérrez
>
>
>
>
> On Thu, May 28, 2009 at 11:16 AM, Patrizio De Michele <[email protected]
> > wrote:
>
>> Hi,
>> it's the second time i meet a strange (for me) problem using Menu.
>> i have a ToolBarMenuButton with attached a Menu, this menu
>> contains various CheckMenuItems.....
>> When i call menu.getItems() it returns an array of BaseItem and not
>> CheckItem so i can't call item.isChecked() to control if is checked or
>> not.
>> Did someone encountered the same problem?
>> Did you know a solution/trickaround?
>> Is it my fault assuming that getItems() should return CheckItem instead of
>> BaseMenuItem?
>>
>> Source Code Follows:
>> .
>> .
>> .
>> .
>> final ToolbarMenuButton toolbarMenuCCButton = new
>> ToolbarMenuButton("CODES");
>> //menu creation
>> final Menu menu = new Menu();
>> int i=0;
>> for (Iterator<String> iterator = codes.iterator(); iterator.hasNext();
>> ++i) {
>>  final CheckItem checkItem = new CheckItem(iterator.next());
>>  menu.addItem(checkItem);
>> }
>> toolbarMenuCCButton.setMenu(menu);
>>
>> //item retrieving
>> BaseItem[] biMenu = menu.getItems();
>> for (int i = 0; i < biMenu.length; i++) {
>>   if (((CheckItem)biMenu[i]).isChecked()) {//this doesn't work because
>> isn't a CheckItem but a BaseItem
>>    choosedCcodes.add(biMenu[i].getTitle());
>>   }
>> }
>> .
>> .
>> .
>>
>> I hope someone could help me,
>> bye Patrizio
>>
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to