-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello dear friends! I have a problem. I have a java class that wants to write a popup-menu in a toolbarbutton. The problem is that when I press the left-button in the mousse, the popup doesn't show. If I put this menu like a context, it show without problems. What can I do? NOTE: the parent of the Button is the Toolbar
Now, I attach my code:
/**** java class that write the toolbarbutton ********/
Tabpanel tabPanel = (Tabpanel) listbox.getParent() .getParent();
Tabbox tabBox = tabPanel.getTabbox();
Toolbar toolbar = new Toolbar();
toolbar.setId("barra_menu_ayuda");
Toolbarbutton btnAyuda = new Toolbarbutton();
btnAyuda.setImage("/imagenes/iconos/menu_tablas.png");
toolbar.appendChild(btnAyuda);
tabBox.appendChild(toolbar);
toolbar.setPopup(new MenuTablaDetalle(this, readOnly,
btnAyuda));
toolbar.setContext(new MenuTablaDetalle(this, readOnly,
btnAyuda));
/******** MenuPopup *************/
public MenuTablaDetalle(GestionMantenimientoVM gestion, boolean readOnly, Toolbarbutton button) { this.gestion = gestion; this.readOnly = readOnly; this.button = button;
this.setParent(button.getParent());
Menuitem insertar = new Menuitem(Labels.getLabel("ut_insertar_detalle",
"Insertar registro"));
insertar.setDisabled(readOnly);
Menuitem modificar = new Menuitem(Labels.getLabel(
"ut_modificar_detalle", "Modificar registro"));
modificar.setDisabled(readOnly);
Menuitem ver = new Menuitem(Labels.getLabel("ut_ver_detalle",
"Ver registro"));
Menuitem eliminar = new Menuitem(Labels.getLabel("ut_eliminar_detalle",
"Eliminar registro"));
eliminar.setDisabled(readOnly);
insertar.addEventListener(Events.ON_CLICK,
new EscuchadorInsertarDetalle(gestion, null));
modificar.addEventListener(Events.ON_CLICK,
new EscuchadorModificarDetalle(gestion, parent));
ver.addEventListener(Events.ON_CLICK, new EscuchadorVisualizarDetalle(
gestion, null, parent));
eliminar.addEventListener(Events.ON_CLICK,
new EscuchadorEliminarDetalle(gestion, null, parent));
this.appendChild(ver);
this.appendChild(new Menuseparator());
this.appendChild(insertar);
this.appendChild(modificar);
this.appendChild(eliminar);
}
Hi. I have the same problem and I have not found any solution. Any luck for you?
Asked: 2014-05-13 11:45:03 +0800
Seen: 14 times
Last updated: Aug 08 '14
Anyone knows something? I am desperate!
ccontreras ( 2014-05-16 09:16:04 +0800 )editNo ones knows what is the problem? Thanks!
ccontreras ( 2014-05-20 09:47:55 +0800 )edit