Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SelectItem changedHandler works in hosted mode but not when deployed

    I have the following code which creates a VLayout with a DynamicForm on which there is only a SelectItem. After the form there is an HTMLPane. Selecting an item in the SelectItem calls setContentsURL() to change the contents of the HTMLPane.
    Code:
    final HTMLPane welcomePage = new HTMLPane();
    welcomePage.setContentsURL("helpcontents/WelcomeHelp.html");
    SelectItem gadgetSelect = new SelectItem("gadgetSelect", "Select a Gadget");
    LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();  
    valueMap.put("helpcontents/WelcomeHelp.html", "Help!");  
    valueMap.put("helpcontents/DailyCandy.html", "Daily Candy");  
    valueMap.put("helpcontents/Trendanistas.html", "Trendanistas");  
    gadgetSelect.setValueMap(valueMap);  
    gadgetSelect.setDefaultToFirstOption(true);
    gadgetSelect.addChangedHandler(new ChangedHandler() {
    	public void onChanged(ChangedEvent event) {
    		welcomePage.setContentsURL(event.getItem().getValue().toString());
    	}
    });
    DynamicForm gadgetForm = new DynamicForm();
    gadgetForm.setItems(gadgetSelect);
    VLayout gadgetLayout = new VLayout();
    gadgetLayout.setMembers(gadgetForm, welcomePage);
    All works just fine in GWT hosted mode, but once deployed, changing the SelectItem has no effect on the HTMLPane contents. If I look at the SmartClient dev console I see this warning each time I change the SelectItem, but I don't understand what it is telling me.

    18:13:22.056:WARN:Log:TypeError: _3.startsWith is not a function

    #2
    In case this has something to do with it, this is the contents of one of the .html files I'm loading into the HTMLPane. Two of the three are iframes like this.
    Code:
    <iframe scrolling="auto" frameborder="0"
    	style="border: 0pt none; margin: 0pt; padding: 0pt; overflow: auto; width: 100%; height: 453px;"
    	name="remote_iframe_122" id="remote_iframe_122"
    	src="http://ig.gmodules.com/gadgets/ifr?view=home&amp;url=http://www.trendanistas.com/fashion.xml&amp;nocache=0&amp;up_title=Trendanistas.com&amp;up_tabFontSize=0.6em&amp;up_showFeedDesc=0&amp;up_feed1=http://www.trendanistas.com/rss2.php%3Fcategory%3D0&amp;up_feedTitle1=Latest&amp;up_feed2=http://www.trendanistas.com/rss2.php%3Fcategory%3D9&amp;up_feedTitle2=Gift+Guide&amp;up_feed3=http://www.trendanistas.com/rss2.php%3Fcategory%3D7&amp;up_feedTitle3=Celebrities&amp;up_feed4=http://www.trendanistas.com/rss2.php%3Fcategory%3D1&amp;up_feedTitle4=Advice&amp;up_entries=10&amp;up_summaries=-1&amp;up_mycolor=Pink&amp;up_renderHtml=1&amp;up_showTimestamp=1&amp;up_selectedTab=&amp;lang=en&amp;country=us&amp;.lang=en&amp;.country=us&amp;synd=ig&amp;mid=122&amp;ifpctok=-5098587205341818061&amp;exp_split_js=1&amp;exp_track_js=1&amp;exp_new_js_flags=1&amp;exp_ids=17259&amp;parent=http://www.google.com&amp;refresh=3600&amp;libs=core:core.io:core.iglegacy:auth-refresh&amp;is_signedin=1" 
    />

    Comment


      #3
      What is the overall arrangement of the frames involved here? This error suggests that SmartGWT is dealing with data that came from another frame.

      Can you get a stack trace for the "startsWith" JS error (from the Developer Console in IE).

      Comment


        #4
        I ended up taking a different approach, slightly more work but still very manageable for my purposes. I first added the gadget to my iGoogle page and then used Firebug to examine the element on the page. It creates a div, like this.
        Code:
        <div style="border: 0pt none; margin: 0pt; padding: 0pt; width: 100%;"
        	id="remote_123"><iframe scrolling="auto" frameborder="0"
        	style="border: 0pt none; margin: 0pt; padding: 0pt; overflow: auto; width: 100%; height: 453px;"
        	name="remote_iframe_123" id="remote_iframe_123"
        	src="http://ig.gmodules.com/gadgets/ifr?view=home&amp;url=http://www.trendanistas.com/fashion.xml&amp;nocache=0&amp;up_title=Trendanistas.com&amp;up_tabFontSize=0.6em&amp;up_showFeedDesc=0&amp;up_feed1=http://www.trendanistas.com/rss2.php%3Fcategory%3D0&amp;up_feedTitle1=Latest&amp;up_feed2=http://www.trendanistas.com/rss2.php%3Fcategory%3D9&amp;up_feedTitle2=Gift+Guide&amp;up_feed3=http://www.trendanistas.com/rss2.php%3Fcategory%3D7&amp;up_feedTitle3=Celebrities&amp;up_feed4=http://www.trendanistas.com/rss2.php%3Fcategory%3D1&amp;up_feedTitle4=Advice&amp;up_entries=10&amp;up_summaries=-1&amp;up_mycolor=Pink&amp;up_renderHtml=1&amp;up_showTimestamp=1&amp;up_selectedTab=&amp;lang=en&amp;country=us&amp;.lang=en&amp;.country=us&amp;synd=ig&amp;mid=123&amp;ifpctok=8348258642280199796&amp;exp_split_js=1&amp;exp_track_js=1&amp;exp_new_js_flags=1&amp;exp_ids=17259&amp;parent=http://www.google.com&amp;refresh=3600&amp;libs=core:core.io:core.iglegacy:auth-refresh&amp;is_signedin=1" /></div>
        So I did the same and it works well inside the HTMLPane.

        Comment

        Working...
        X