Hello

I am  putting all my advertisements code in a Ads.html file in server
and my gwt application gets the the whole html file and displays the
ads into right side of the page in a HTML widget.This works as longs
there is no java script in my Ads.html, but, when I start adding java
script ads in Ads.html, my gwt application hangs when it starts
loading in browser. The purpose of keeping Ads.html in separate file
is, some one will keep updating the ads in it more frequently. Could
any one help to identify what's wrong with my code ?. Thanks

Code:
====

package com.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.Response;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;


public class Index implements EntryPoint {

    private DockPanel template = new DockPanel();
    HorizontalPanel top = new HorizontalPanel();
    VerticalPanel rightMenu = new VerticalPanel(); /// It will be used
third party Ads, like, Google Ads etc.
    VerticalPanel leftMenu = new VerticalPanel();
    VerticalPanel contentBody =  new VerticalPanel();

    public void onModuleLoad() {
        top();
        rightMenu();
        contentBody();
        leftMenu();

        template.add(top, DockPanel.NORTH);
        template.add(leftMenu, DockPanel.WEST);
        template.add(contentBody, DockPanel.CENTER);
        RootPanel.get().add(template);

    }

    public void top()
    {
        Label lbl = new Label("Masthead Panel");
        top.add(lbl);
    }

    public void rightMenu()
    {

        RequestBuilder builder = new RequestBuilder(RequestBuilder.GET,
"Ads.html");
        try {
            builder.sendRequest(null, new RequestCallback () {

                public void onError(Request request, Throwable exception) {
                    Window.alert("Error occured on your request.")    ;
                }

                public void onResponseReceived(Request request, Response
response)
{
                    GWT.log(response.getText(), null);
                    HTML rightMenuHtml = new HTML(response.getText());
                    rightMenu.add(rightMenuHtml);
                    template.add(rightMenu, DockPanel.EAST);

                }

            });
        } catch (Exception e) {

            e.printStackTrace();
        }

    }

    public void contentBody()
    {
        Label lbl = new Label("Content Body");
        contentBody.add(lbl);

    }

    public void  leftMenu()
    {
        Label lbl = new Label("Left Menus");
        leftMenu.add(lbl);
    }

}


Ads.html
=======

<script language="javascript" src="http://www.buy.com/retail/
affiliates/promo_fades125.asp?aid=10390502&pid=&sid="></script><a
href="http://www.buy.com";><img src="http://ak.buy.com/buy_assets/v5/
img/clear.gif" width="1" height="60" border="0"></a>




-- 
Regards,
Sarav

--~--~---------~--~----~------------~-------~--~----~
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