Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Javascript integration

$
0
0
Hi

I build my web application using SmartGwt for graphic.

Now I found this http://slideshow.triptracker.net/ fantastic script for add a Photogallery to my application.

The problem is I cannot find the correct way to do this. My first try was.

Code:

                ScriptInjector.fromUrl("http://slideshow.triptracker.net/slide.js").setCallback(
                                  new Callback<Void, Exception>() {
                                            public void onFailure(Exception reason) {
                                              Window.alert("Script load failed.");
                                            }
                                            public void onSuccess(Void result) {
                                              Window.alert("Script load success.");
                                            }
                                          }).inject();


and then call this method:

Code:


        native static void example(String p) /*-{
               
                $wnd.viewer = new $wnd.PhotoViewer();
                $wnd.viewer.add(p)
                $wnd.viewer.show(0);

        }-*/;

this did not give any error but the photogallery appears BEHIND my Entry Point Layout, so it's not possible to use it.

Now I'm trying to refer to the main layout from Javasript, to run the script on that. Is this possible?

I've tried with

Code:

foo.getElement().getId();
but it returns me something like

isc_VLayout_0_wrapper

that the Javascript refuses

then I tried foo.getDOM.getId();

isc_1

same story.




Can someone tell me the way to do this?

Thank You.

Viewing all articles
Browse latest Browse all 4756

Trending Articles