I would guess that "lightbox.js" executes once loaded and that is
happening prior to your GWT code executing to add the hyperlink to the
DOM (thus it gets missed).

The lightbox.js code (http://www.dynamicdrive.com/dynamicindex4/
lightbox2/js/lightbox.js) says this "initialize() - a constructor runs
on completion of the DOM loading.", so above would appear to be true -
perhaps you can find a way to call the initialize() code through JSNI
once you are done with your GWT code inserting DOM elements?

//Adam


On 28 Apr, 13:24, "[email protected]" <[email protected]>
wrote:
> Hi all,
>
> I am searching for a GWT solution to do something like this page
> explains :http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm
>
> I thought it would be easy to create this in GWT by just doing the
> following steps :
> - Put the javascript files in public/js/
> - Put the css in public/ccs/
> - Add the following to the html :
>             <script type="text/javascript" src="js/prototype.js"></script>
>             <script type="text/javascript" src="js/scriptaculous.js?
> load=effects"></script>
>             <script type="text/javascript" src="js/lightbox.js"></script>
> - Add the following to the html:
>             <link rel="stylesheet" href="css/lightbox.css" type="text/
> css" media="screen" />
> - And finally in GWT code do : HTML html = new HTML("<a href=\"" +
> pictureUrl + "\" rel=\"lightbox\" title=\"" + title + "\">" + title +
> "</a>");
>
> But when I click the link it just opens the image as a normal image. I
> am 100% sure the javascript and css code is found. If I add the a href
> simply to my html page as a test it just works no problem. But when I
> generate the a href inside gwt the ref part seems to get ignored.
> I also inspected the generated html in firefox and everything looks
> perfectly fine. But when clicked on a link it just opens a page that
> just shows the image instead of using the LightBox stuff.
>
> Anyone has any idea what is wrong ? Or are their GWT image-viewer
> widgets like this javascript thing out there ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to