ScrollPanel inside DisclosurePanel inside DialogBox does not work on all browsers in OSX Lion

226 views
Skip to first unread message

Phineas Gage

unread,
Sep 20, 2011, 9:46:04 AM9/20/11
to Google Web Toolkit
Using GWT 2.4.0, I'm trying to create a DialogBox for errors
containing a message and a stack trace inside a DisclosurePanel, but
in OSX Lion, scrolling doesn't work in Google Chrome and Safari. It
works on Firefox for OSX Lion, IE for XP and Google Chrome for XP. For
the browsers that it doesn't work on, it sometimes begins to scroll
for a few pixels but then stops.

So far I've tried setting the size on the ScrollPanel explicitly,
turning off animation, and using a Grid instead of a FlowPanel for my
dialog layout, but I just can't seem to get it to work.

Here are the UiBinder xml files and associated Java classes:

ErrorDialogBox.ui.xml:
------
<?xml version="1.0" encoding="UTF-8"?>

<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui">

<ui:style>
.title {
text-align: center;
font-weight: bold;
}

.desc {

}

.stacktrace {
font-family: "Courier New";
word-wrap: "break-word";
}
</ui:style>

<g:Grid>
<g:row>
<g:customCell>
<g:HTML styleName="{style.title}" ui:field='m_th' />
</g:customCell>
</g:row>
<g:row>
<g:customCell>
<g:HTML styleName="{style.desc}" ui:field='m_dh' />
</g:customCell>
</g:row>
<g:row>
<g:customCell>
<g:DisclosurePanel animationEnabled="true">
<g:header>Stack Trace:
</g:header>
<g:ScrollPanel width="390px" height="200px">
<g:HTML styleName="{style.stacktrace}" ui:field='m_sth' />
</g:ScrollPanel>
</g:DisclosurePanel>
</g:customCell>
</g:row>

</g:Grid>

</ui:UiBinder>
------

ErrorDialogBox.java:

public final class ErrorDialogBox extends DialogBox
{

// UiBinder fields
interface ErrorDialogBoxUiBinder extends UiBinder<Grid,
ErrorDialogBox>
{
}

private static ErrorDialogBoxUiBinder s_uib =
GWT.create(ErrorDialogBoxUiBinder.class);

@UiField HTML m_th;

@UiField HTML m_dh;

@UiField HTML m_sth;

public ErrorDialogBox(final String sTitle, final String sDesc, final
Throwable t)
{
setTitle(sTitle);
setGlassEnabled(true);
setAnimationEnabled(true);
setModal(true);

final Grid gr = s_uib.createAndBindUi(this);

m_th.setHTML(sTitle);
m_dh.setHTML(sDesc);
m_sth.setHTML(GwtUtility.getStackTraceHtml(t));

setWidget(gr);
}

}

-----

And some code to create an error dialog box (where "thr" is some
Throwable):

final ErrorDialogBox edb = new ErrorDialogBox("Title", "Description",
thr);
edb.center();
edb.show();

------

Does anyone know what this is or how to fix / workaround it?

Jens

unread,
Sep 20, 2011, 12:17:47 PM9/20/11
to google-we...@googlegroups.com
I use a PopupPanel with a ScrollPanel that contains somewhere a DisclosurePanel that in turn contains a ScrollPanel in its content area and it works.

But I think I had some issues but could not remember which ones. 

Can you try and use setModal(false) on your PopupPanel? I don't use setModal(true) as I already have the glasspane active which is in most cases enough.
You can also try and change some Mac OS Lion settings: Preferences -> General -> activate "show scrollbars when scrolling".

-- J.

Phineas Gage

unread,
Sep 20, 2011, 12:34:32 PM9/20/11
to Google Web Toolkit
Replacing setModal(true) above with setModal(false) works for me and
still seems to work in the other browsers. It's hard to say whether
that's a bug or not, but setModal(false) avoids it.

Many thanks...

Pete
Reply all
Reply to author
Forward
0 new messages