Phineas Gage
unread,Sep 20, 2011, 9:46:04 AM9/20/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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?