Hello,
I am using
SmartClient Version: v8.3p_2013-04-19/PowerEdition Deployment (built 2013-04-19)
I am having trouble getting the event to "hide" my window when I want to.
I have a class
This class has some things displayed in it. Including
We show the listGrid when the user types some text in the textItem. And when the user moves outside the "Window" class I have AND (and this is the hard part) select somewhere else in the parent of Window. I want to "hide" the listGrid in window.
How can I trap ALL events that mouse makes so that I can have listGrid hidden when the user clicks outside of it.
I have added various handlers to listgird and window and not managed to get it right.
Here are some of the handlers I tried. Is there anyway to make this posting window on the thread wider? So that my code below is not wrapped so oddly?
Thanks,
Evan
I am using
SmartClient Version: v8.3p_2013-04-19/PowerEdition Deployment (built 2013-04-19)
I am having trouble getting the event to "hide" my window when I want to.
I have a class
Code:
public class SearchWindowArea extends Window { ...
Code:
TextItem textItem = new TextItem(); ListGrid listGrid = new ListGrid();
How can I trap ALL events that mouse makes so that I can have listGrid hidden when the user clicks outside of it.
I have added various handlers to listgird and window and not managed to get it right.
Here are some of the handlers I tried. Is there anyway to make this posting window on the thread wider? So that my code below is not wrapped so oddly?
Thanks,
Evan
Code:
private void setupHideListGridHandlers() { // TODO // What we want is ALL mouse events to be caught by the window which can then figure out if it wants to hide itself. // So I "think" a way is through this.addEvent would be what we want to try using. // Not sure how to do this, might take some thought... // not sure this is what we want ClickHandler clickHandlerWindow = new ClickHandler() { @Override public void onClick(ClickEvent event) { if (!(getCurrentGrid().containsEvent() || toolStrip.containsEvent())) { forceHideGrid(); } } }; this.addClickHandler(clickHandlerWindow); FocusChangedHandler focusChangedHandler1 = new FocusChangedHandler() { @Override public void onFocusChanged(FocusChangedEvent event) { hideTheListGrid(); }; }; this.addFocusChangedHandler(focusChangedHandler1); FocusChangedHandler focusChangedHandler2 = new FocusChangedHandler() { @Override public void onFocusChanged(FocusChangedEvent event) { hideTheListGrid(); }; }; listGrid.addFocusChangedHandler(focusChangedHandler2); treeGrid.addFocusChangedHandler(focusChangedHandler2); BlurHandler blurHandler = new BlurHandler() { @Override public void onBlur(BlurEvent event) { hideTheListGrid(); } }; textItem.addBlurHandler(blurHandler); // This is the one that really controls the list grid MouseOutHandler handlerMouseOutHandler = new MouseOutHandler() { @Override public void onMouseOut(MouseOutEvent event) { hideTheListGrid(); } }; this.addMouseOutHandler(handlerMouseOutHandler); SelectionChangedHandler selectionChangedHandler = new SelectionChangedHandler() { @Override public void onSelectionChanged(SelectionEvent event) { textItem.focusInItem(); } }; listGrid.addSelectionChangedHandler(selectionChangedHandler); }
Comment