Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does JScrollPane work with GWT? #22

Closed
dafinley opened this issue Oct 15, 2010 · 3 comments
Closed

Does JScrollPane work with GWT? #22

dafinley opened this issue Oct 15, 2010 · 3 comments

Comments

@dafinley
Copy link

Has anyone had any success with GWT and this JScrollPane plugin working together.

@dafinley
Copy link
Author

Actually figured it out. JScrollPane is expecting all the div elements to be in place when it runs...otherwise it would by psychic. Problem with gwt is that it runs all the javascript then starts processing the java code that creates the display elements.
By using a native event, and passing in the object, as so:

private static native void jScrollPane(YourClass y)/*-{

$wnd.showout = function(){

if(y.@com.board.client.YourClass::firstTime()()){
$wnd.jQuery('.YourCssClass').jScrollPane();
y.@com.board.client.YourClass::notLongerFirstTime()();
}

}

}-*/;

Now you pass the showout javascript function to the onmouseover function of whatever element you want to effect using the getElement().setAttribute("onmouseover", "showout()") syntax and you should be golden

@vitch
Copy link
Owner

vitch commented Oct 17, 2010

Glad you figured it out. If you look at all of the jScrollPane examples you will see that the code to initialise jScrollPane happens in a jQuery document ready block. This ensures that the DOM is ready and so manipulations can be done to it when jScrollPane is initialised. I'm not familiar with GWT but I guess your code above is in some way equivalent to this...

@akopensrc
Copy link

Hi dafinley,

The native method you mentioned, where to put this method and where to call this method from?

It would be great if you provide some explanation of the native method.
Thanks

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants