How to call onBrowserEvent () EditTextCell programmatically from Javascript?

How to call onBrowserEvent from EditTextCell programmatically from Javascript?

I overwrite onBrowserEvent in my customEditTextCell, which is called when the user clicks on the cell. I also want to call from another event.

public void onBrowserEvent(Context context, Element parent, String value, NativeEvent event, ValueUpdater<String> valueUpdater) { // my custom code is here } 

When I click on a cell, the above method is called and a jQuery (picker) popup window opens. JQuery has a Done popup button.

When I click Finish, I want to call the above gwt-java method. How to do it?

I know that we can call the java-gwt method from Javascript, but I am facing some problem when passing parameters like context, parent, value, event, valueUpdater

How to pass context, parent, value, event, valueUpdater parameter from Javascript to gwt-java method?

In my on-module, I called registerOnBrowserEventForDateTimePicker() and wrote the following method: what’s wrong, the gwtc compilation failed, please correct me.

Myclass.java

 public static native void registerOnBrowserEventForDateTimePicker() /*-{ $wnd.callOnBrowserEventForDateTimePicker =$entry@ui.gwtmassupdateui.client.widgets.TimestampPickerCell :: callOnBrowserEventForDateTimePicker(com/google/gwt/cell/client/Cell/Context,com/google/gwt/dom/client/Element,Ljava/lang/String,com/google/gwt/dom/client/NativeEvent,com/google/gwt/dom/client/NativeEvent); }-*/; 

Any sample code for the same or pointers to do it right

+4
source share
1 answer

I would do this with another anonymous object that contains the method context. Something like that:

 private Runnable contextCall; public void onBrowserEvent(final Context context, final Element parent, final String value, final NativeEvent event, final ValueUpdater<String> valueUpdater) { contextCall = new Runnable() { public void run() { // my custom code is here } }; contextCall.run(); } public void callOnBrowserEventForDateTimePicker() { contextCall.run(); } 
0
source

All Articles