Go Back   SmartClient Forums > Smart GWT Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 16th Aug 2010, 01:00
urquanx urquanx is offline
Registered Developer
 
Join Date: Aug 2010
Posts: 4
Default Showing double scrollbar.

I used the "Basics->HTML->Load HTML pages in IFrame" example's source code from the SmartGWT showcase page but in my case an extra vertical scrollbar is appearing in the component and resulting in a double scrollbar view.
I uploaded the attachment image that shows the page.

How can I get rid of the extra scrollbar? Thanks in advance.

Anyone tried the code and having the same problem ?

Edit: Running on Windows XP,Mozilla 3.6.8, SmartGWT 2.2

Code from showcase

Code:
import com.smartgwt.client.types.ContentsType;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLPane;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.layout.HStack;
import com.smartgwt.client.widgets.layout.VLayout;

public class IFramesSample implements EntryPoint {

    public void onModuleLoad() {
        VLayout layout = new VLayout();
        layout.setWidth100();
        layout.setHeight100();

        final HTMLPane htmlPane = new HTMLPane();
        htmlPane.setShowEdges(true);
        htmlPane.setContentsURL("http://www.google.com/");
        htmlPane.setContentsType(ContentsType.PAGE);

        HStack hStack = new HStack();
        hStack.setHeight(50);
        hStack.setLayoutMargin(10);
        hStack.setMembersMargin(10);

        IButton yahooButton = new IButton("Yahoo");
        yahooButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                htmlPane.setContentsURL("http://www.yahoo.com/");
            }
        });
        hStack.addMember(yahooButton);

        IButton googleButton = new IButton("Google");
        googleButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                htmlPane.setContentsURL("http://www.google.com/");
            }
        });
        hStack.addMember(googleButton);

        IButton wikipediaButton = new IButton("Wikipedia");
        wikipediaButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                htmlPane.setContentsURL("http://www.wikipedia.org/");
            }
        });
        hStack.addMember(wikipediaButton);

        IButton baiduButton = new IButton("Baidu");
        baiduButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                htmlPane.setContentsURL("http://www.baidu.com/");
            }
        });
        hStack.addMember(baiduButton);

        layout.addMember(hStack);
        layout.addMember(htmlPane);
        layout.draw();
    }

}
Attached Images
File Type: png myversion.PNG (61.5 KB, 108 views)

Last edited by urquanx; 16th Aug 2010 at 05:35.. Reason: add source code
Reply With Quote
  #2  
Old 19th Aug 2010, 11:52
urquanx urquanx is offline
Registered Developer
 
Join Date: Aug 2010
Posts: 4
Default

Too bad no one has at least tried the source code :(
Reply With Quote
  #3  
Old 20th Aug 2010, 12:07
bartyhoho bartyhoho is offline
Registered Developer
 
Join Date: Jul 2010
Posts: 22
Default

I had the same problem. Although I don't have a good solution, I can at least hide the scrollbar by setting its size to 0. Like this:
Code:
htmlPane.setScrollbarSize(0);
Reply With Quote
  #4  
Old 25th Aug 2010, 00:23
urquanx urquanx is offline
Registered Developer
 
Join Date: Aug 2010
Posts: 4
Default

Thanks I'll try it and tell if it works.
Reply With Quote
  #5  
Old 27th Aug 2010, 00:21
urquanx urquanx is offline
Registered Developer
 
Join Date: Aug 2010
Posts: 4
Default

That solved the problem thanks a lot! There has to be a more natural way to do it though.
Reply With Quote
  #6  
Old 3rd Sep 2010, 03:58
caiyunfei caiyunfei is offline
Registered Developer
 
Join Date: Sep 2010
Posts: 2
Default

I meet the same problem. Is there someone being able to resovle it?
Reply With Quote
  #7  
Old 5th Sep 2010, 04:20
caiyunfei caiyunfei is offline
Registered Developer
 
Join Date: Sep 2010
Posts: 2
Default

Isn't there anyone can resolve the problem?
Reply With Quote
  #8  
Old 4th Oct 2010, 07:21
garyswindell garyswindell is offline
Registered Developer
 
Join Date: Apr 2009
Posts: 19
Default

I am having the same issue. Why does the extra scroll bar appear?
Reply With Quote
  #9  
Old 28th Jun 2012, 15:14
iHATEsmartgwtALOT iHATEsmartgwtALOT is offline
Registered Developer
 
Join Date: Jun 2012
Posts: 1
Default

Smart GWT 3.0 still has the issue. Somewhere mentioned using:

htmlPane.setOverflow(Overflow.HIDDEN);

...but no worky because now 0 scrollbars are show instead of the desired 1 scrollbar. I only got success when using CSS:

htmlPane.addStyleName("noscroll");

.noscroll {
overflow: hidden !important;
}

This works in Firefox 11, Chrome 19 & 20, and IE 9.

PS: the username "iHATEsmartgwt" was already taken. i guess i'm not surprised.
Reply With Quote
  #10  
Old 28th Jun 2012, 15:22
Isomorphic Isomorphic is online now
Administrator
 
Join Date: May 2006
Posts: 38,986
Default

Direct your ire properly..

This kind of thing can be introduced because of the CSS used by core GWT themes (see FAQ), bad DOCTYPE settings, or weirdness in the included site.

There really is no general fix because iframes are flaky and security restrictions prevent us from reaching into the loaded page and trying to detect/adjust for its settings. This is why the docs tell you not to use this mode if at all possible.

As far as this thread, no one has posted enough information for us to investigate any particular case. There's just one guy reposting a Showcase sample saying it didn't work on his machine, but not providing any other details.

So, no need to start flaming the technology - just read and follow the instructions.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


© 2010,2011 Isomorphic Software. All Rights Reserved