You are right, there is something about that technique that doesn't work.  I
found this alternative implementation of the gadget worked, though:

In SimpleFriendConnect.html, add:

  <!-- Include the Google Friend Connect javascript library. -->
  <script type="text/javascript" src="
http://www.google.com/friendconnect/script/friendconnect.js";></script>


Then, I took the HTML code and translated it to JSNI:

package com.example.simpleFriendConnect.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Document;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class SimpleFriendConnect implements EntryPoint {

  static native void addFriendConnect(String divId) /*-{
     var skin = {};
     skin['BORDER_COLOR'] = '#cccccc';
     skin['ENDCAP_BG_COLOR'] = '#e0ecff';
     skin['ENDCAP_TEXT_COLOR'] = '#333333';
     skin['ENDCAP_LINK_COLOR'] = '#0000cc';
     skin['ALTERNATE_BG_COLOR'] = '#ffffff';
     skin['CONTENT_BG_COLOR'] = '#ffffff';
     skin['CONTENT_LINK_COLOR'] = '#0000cc';
     skin['CONTENT_TEXT_COLOR'] = '#333333';
     skin['CONTENT_SECONDARY_LINK_COLOR'] = '#7777cc';
     skin['CONTENT_SECONDARY_TEXT_COLOR'] = '#666666';
     skin['CONTENT_HEADLINE_COLOR'] = '#333333';
     skin['DEFAULT_COMMENT_TEXT'] = '- add your comment here -';
     skin['HEADER_TEXT'] = 'Comments';
     skin['POSTS_PER_PAGE'] = '5';

    // NOTE: Prepend $wnd to the calls to the friendconnect API.
     $wnd.google.friendconnect.container.setParentUrl('/users/eric/');
     $wnd.google.friendconnect.container.renderWallGadget(

      // NOTE: substitute 'divId' for the string generated by Google
Friendconnect
      { id: divId,
        site: '01989614359727495564',
        'view-params':{"disableMinMax":"true",
          "scope":"PAGE","features":"video,comment",
          "startMaximized":"true"}
      }, skin);
   }-*/;

  /**
   * This is the entry point method.
   */
  public void onModuleLoad() {
    RootPanel.get().add(new Label("Member Gadget shown below:"));
    DivElement gadgetDiv = Document.get().createDivElement();
    String id = "div-friendconnect1";
    gadgetDiv.setId(id);
    gadgetDiv.getStyle().setPropertyPx("width", 282);
    gadgetDiv.getStyle().setProperty("border", "1px, solid #cccccc");
    RootPanel.get().getElement().appendChild(gadgetDiv);
    addFriendConnect(id);
  }
}

On Wed, Mar 4, 2009 at 9:18 PM, Xiongjia Le <lexiong...@gmail.com> wrote:

>
> Hi All,
>
> Yesterday, I wrote a test page for  add the gadget of "Google Friend
> Connect" to my GWT page.
>
> I create a new HTML object and set the gadget's script (got from
> "Google Friend Connect" ) to this object.
> This is the code summary:
>
> ----------------
> HTML htmObj = new HTML("<!-- some script got from 'Google Friend
> Connect'-->")
> RootPanel.get().add(htmObj);
> ----------------
>
> But this code only can run on Firefox. In other browsers (IE, Chrome,
> etc.) the gadget is can not show correctly.
>
> Do we need use other way to add a 3rd party gadgets to GWT page?
>
> Thanks,
> Xiongjia Le
> >
>


-- 
Eric Z. Ayers - GWT Team - Atlanta, GA USA
http://code.google.com/webtoolkit/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to