PDA

View Full Version : Context Menu declared in uibinder is shown on reveal



nakhli
25 Jan 2012, 7:07 AM
Using ext gwt beta 3.0.0 - beta2 with gwtp 0.6
when a context menu is declared as follows:


<ui:UiBinder
xmlns:container="urn:import:com.sencha.gxt.widget.core.client.container"
xmlns:menu="urn:import:com.sencha.gxt.widget.core.client.menu">


<container:FlowLayoutContainer addStyleNames="row">
<menu:Menu ui:field="_contextMenu" shadow="true" visible="false" />
</ontainer:FlowLayoutContainer>
</ui:UiBinder>

It is shown when the widget is first shown, before the mouse is clicked. setting the visible attribute to false doesn't change things.

sven
25 Jan 2012, 7:30 AM
You are not setting any contextmenu. You are setting the menu as normal child to your FlowLayoutContainer. You need to add it to the contextMenu attribute of the FlowLayoutContainer. To make this work you will need to provide it or use the GXT UiBinder bridge and add it using ui attributes.

nakhli
26 Jan 2012, 1:19 AM
Thank you for your quick answer. And how to declare a context menu in the xml then?

PhiLho
26 Jan 2012, 7:34 AM
You probably need to declare it separately in a distinct .ui.xml and attach it to the view when needed.