Revision history [back]

click to hide/show revision 1
initial version

asked 2012-08-21 10:51:37 +0800

tizios gravatar image tizios

BorderLayout, setOpen by code not fire onopen event?

I would like to face the pressure of a combination of keys (es: CTRL+M), open the BorderLayout (West) and give the focus to the first content control.

In my code i have:

mainLayout.addEventListener(Events.ON_CTRL_KEY, new EventListener<KeyEvent>() {
    @Override
    public void onEvent(KeyEvent event) throws Exception {

        if (event.getKeyCode() == (byte)'M' && event.isCtrlKey()) 
        layoutWest.setOpen(!layoutWest.isOpen());

    event.stopPropagation();
    }
});

i have also:

@Listen(Events.ON_OPEN+"=#layoutWest")
    public void onOpenMenuLeft() {
        if (layoutWest.isOpen())
            treeMain.focus();  //  first  content control of the BorderLayout West component.
    }

If i open the BorderLayout West using the mouse, everything works perfectly. If you instead use the layoutwest.setopen(True) from the code, the onopen event of component LayoutWest, is not raised.

What one can help me understand?

Thanks

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