0

Popup in a Toolbarbutton

asked 2014-05-13 11:45:03 +0800

ccontreras gravatar image ccontreras
26 1

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);
}
delete flag offensive retag edit

Comments

Anyone knows something? I am desperate!

ccontreras ( 2014-05-16 09:16:04 +0800 )edit

No ones knows what is the problem? Thanks!

ccontreras ( 2014-05-20 09:47:55 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-08-08 15:42:40 +0800

mariusdoru gravatar image mariusdoru
3 1

Hi. I have the same problem and I have not found any solution. Any luck for you?

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2014-05-13 11:45:03 +0800

Seen: 14 times

Last updated: Aug 08 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More