I'm having an issue trying to call a JS function from Java using Errai 2.3.2 I'm using Bootstrap switch and I need to invoke a JS function in order to activate it. I need to do this after the page is created and all the elements are attached to the DOM element.
I've tried it all: @PostConstruct, @PageShowing, @PageShown, onAttach().. but none of those worked for me.
I have this:
@Override
public void onAttach(){
enableToggleSwitch();
}
public static native void enableToggleSwitch() /*-{
$wnd.enableToggle();
}-*/;
and when I debug it, it seems to be that the onAttach() method is invoked before the elements are attached to the DOM.
Any ideas?