Hi gabriel, i'd like to thank you. Your solution was the right one, but internet explorer as always creates problems so i found a different way, less elegant way but functionally equivalent. I set directly the attribute overflow in this manner:
DOM.setStyleAttribute(menu.getElement(), "overflow", "auto"); the reason of IE7 misfunction is that "overflow" attribute is set as "hidden" for the element menu before the application of the style added so ignores the new value. Again thanks, Patrizio 2009/5/28 Gabriel Ernesto Gutierrez Añez <[email protected]> > The solution seams to be easier > > Just add some css to the Menu object and add this properties > > menu.addStyleName("scrollable"); > > in some .css file add this > > .scrollable{ > height:50%; > overflow: auto; > } > > Just adjust height value. > Remember to import the css file in the module file (.gwt.xml) > Here is an screen shoot > > It only worked on FireFox not for IE 7 or the GWT Benchmark tool, so maybe > I'm missing something so it can work on them > > But, having 41 items inside a Menu is a problem, i mean, the user is > definitely going to complain, you should use more ToolBarButtons with Menu > so u can split them like a ToolBar, try to categorize and separate them. > > Regards, > _____________________ > Ing. Gabriel Gutiérrez > > > > > On Thu, May 28, 2009 at 12:50 PM, Patrizio De Michele <[email protected] > > wrote: > >> Good lunch and don't worry here is dinner time and so i'm goin' home :)... >> the solution i have thinked about menu is to split the 41 items inside the >> main menu and other (for example) 3 submenus hoping to make the submenu >> going down-up when needed instead of always up-down as usual. >> bye, >> patrizio >> >> 2009/5/28 <[email protected]> >> >> let me do some research maybe I can come with any idea. I'm in lunch jeje >>> so give me some time. I'm glad I could help >>> >>> ^_^ >>> >>> Regards, >>> >>> Sent from my BlackBerry® from Iusacell wireless device from Iusacell >>> >>> ------------------------------ >>> *From*: Patrizio De Michele >>> *Date*: Thu, 28 May 2009 19:29:02 +0200 >>> *To*: <[email protected]> >>> *Subject*: Re: strange problem with Menu >>> Yep! You're the man! >>> The first one is right :) but also the second is right too ;)...... >>> Obviously i preferred the first 'cause is more elegant and more important >>> it preserves memory ;). >>> You're very kind and also very prepared ;) if you'll need help in the >>> future you're wellcome :). >>> But.... >>> i have another question about menu.... >>> i have a lot of elements inside this menu (41exactly at about 22px per >>> each it becomes at least 902px :)) too many cause menu goes outside of the >>> browser, is it possible to have a scrollbar like in comboboxes?? >>> Or at least to scroll elements with mouse wheel (with up/down arrows i >>> can see all items)? >>> Is there a way to cacth wheel movement with a custom listener?? >>> >>> Bye and thanx a lot, >>> Patrizio >>> >>> >>> >>> 2009/5/28 Gabriel Ernesto Gutierrez Añez <[email protected]> >>> >>>> 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 -~----------~----~----~----~------~----~------~--~---
