movit / attestator

0 stars 0 forks source link

При paste не начинается поиск #64

Closed movit closed 11 years ago

movit commented 11 years ago

При paste мышкой не начинается поиск

movit commented 11 years ago

@Override public void onModuleLoad() {

final TextBox textBox = new TextBox();
final int delayMilliseconds = 1000;

Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {

    private String previousValue = "";

    @Override
    public boolean execute() {

        final String newValue = textBox.getValue();
        if (!previousValue.equals(newValue)) {
            try {
                valueChanged();
            } finally {
                previousValue = newValue;
            }
        }
        return true;
    }

    private void valueChanged() {
        // React on the change
        Window.alert("Value changed");
    }

}, delayMilliseconds);

RootPanel.get().add(textBox);

}

movit commented 11 years ago

public native void addCutHandler(Element elementID) /-{ var temp = this; // hack to hold on to 'this' reference elementID.oncut = function(e) { temp.@org.package.YourClass::handleCut()(); } }-/;

public void handleCut() { Window.alert("Cut!"); }

movit commented 11 years ago

final Listener l = new Listener() { public void handleEvent(final FieldEvent fe) { ... else if (fe.getType() == Events.OnPaste) { final Timer pasteFix = new Timer() { @Override public void run() { if (isDirty()) { this.cancel(); validate(); } schedule(100); } }; pasteFix.schedule(100); } } };

   ... (other listener events)
   addListener(Events.OnPaste, l);

   sinkEvents(Event.ONPASTE);

http://www.sencha.com/forum/showthread.php?113373

movit commented 11 years ago

http://www.sencha.com/forum/showthread.php?90117-Combobox-on-mouse-paste-not-refreshing