Comments (9)
Here is some testing code that shows the problem:
public void onModuleLoad() {
final RootPanel root = RootPanel.get();
FlexTable t = new FlexTable();
root.add(t);
ScrollPanel p = new ScrollPanel();
p.setWidth("300px");
p.setHeight("300px");
root.add(p);
p.add(t);
t.setWidth("600px");
t.setHeight("600px");
t.setBorderWidth(10);
t.setWidget(0,0,createLocationButton(p, "top left"));
t.setWidget(0,1,createLocationButton(p, "top right"));
t.setWidget(1,0,createLocationButton(p, "bottom left"));
t.setWidget(1,1,createLocationButton(p, "bottom right"));
}
private Button createLocationButton(ScrollPanel p, String title) {
final Button b = new Button(title);
b.addClickListener(new ClickListener(){
public void onClick(Widget sender) {
Window.alert("Left:" + b.getAbsoluteLeft() + "\nTop:" +b.getAbsoluteTop() );
}
});
return b;
}
}
Reported by gwt.team.ecc
on 2006-09-21 11:33:20
from gwt.
Reported by gwt.team.bruce
on 2006-09-21 20:10:15
- Labels added: Priority-High, Milestone-1_2_RC
- Labels removed: Priority-Medium
from gwt.
Below is a more complete test. Fails for Opera.
public void onModuleLoad() {
final RootPanel root = RootPanel.get();
root.add(new Label("check scroll offset"));
FlexTable t = new FlexTable();
root.add(t);
ScrollPanel p = new ScrollPanel();
p.setWidth("300px");
p.setHeight("300px");
root.add(p);
p.add(t);
t.setWidth("600px");
t.setHeight("600px");
t.setBorderWidth(10);
t.setWidget(0,0,createLocationButton(p, "top left"));
t.setWidget(0,1,createLocationButton(p, "top right"));
t.setWidget(1,0,createLocationButton(p, "bottom left"));
t.setWidget(1,1,createLocationButton(p, "bottom right"));
root.add(new Label("Check border offset"));
final FlowPanel flowPanel = new FlowPanel();
root.add(flowPanel);
flowPanel.setStyleName("my-BigBorder");
flowPanel.setSize("409px", "195px");
{
final Button button = new Button();
flowPanel.add(button);
button.addClickListener(new ClickListener() {
public void onClick(Widget e) {
Window.alert("flowPanel location: " + flowPanel.getAbsoluteLeft() + ", "
+ flowPanel.getAbsoluteTop() + "\nbutton location: " +
button.getAbsoluteLeft() + ", "
+ button.getAbsoluteTop());
}
});
button.setText("getLocation");
}
}
private Button createLocationButton(ScrollPanel p, String title) {
final Button b = new Button(title);
b.addClickListener(new ClickListener(){
public void onClick(Widget sender) {
Window.alert("Left:" + b.getAbsoluteLeft() + "\nTop:" +b.getAbsoluteTop() );
}
});
return b;
}
Reported by gwt.team.ecc
on 2006-09-25 12:04:30
from gwt.
#added absolutely possitions button to example above
public void onModuleLoad() {
final RootPanel root = RootPanel.get();
root.add(new Label("______Scroll offset"));
FlexTable t = new FlexTable();
root.add(t);
ScrollPanel p = new ScrollPanel();
p.setWidth("300px");
p.setHeight("300px");
root.add(p);
p.add(t);
t.setWidth("600px");
t.setHeight("600px");
t.setBorderWidth(10);
t.setWidget(0,0,createLocationButton("top left"));
t.setWidget(0,1,createLocationButton("top right"));
t.setWidget(1,0,createLocationButton("bottom left"));
t.setWidget(1,1,createLocationButton("bottom right"));
root.add(new Label("Check border offset"));
final FlowPanel flowPanel = new FlowPanel();
root.add(flowPanel);
flowPanel.setStyleName("my-BigBorder");
flowPanel.setSize("409px", "195px");
{
final Button button = new Button();
flowPanel.add(button);
button.addClickListener(new ClickListener() {
public void onClick(Widget e) {
Window.alert("flowPanel location: " + flowPanel.getAbsoluteLeft() + ", "
+ flowPanel.getAbsoluteTop() + "\nbutton location: " +
button.getAbsoluteLeft() + ", "
+ button.getAbsoluteTop());
}
});
button.setText("getLocation");
}
Button absolute= createLocationButton("absolute");
root.add(absolute, 10,10);
}
private Button createLocationButton(String title) {
final Button b = new Button(title);
b.addClickListener(new ClickListener(){
public void onClick(Widget sender) {
Window.alert("Left:" + b.getAbsoluteLeft() + "\nTop:" +b.getAbsoluteTop() );
}
});
return b;
}
Reported by gwt.team.ecc
on 2006-09-26 11:55:05
from gwt.
Fixed on Mozilla by manually crawling through parents and looking for scroll panels.
Reported by gwt.team.ecc
on 2006-09-26 18:33:10
- Status changed:
FixedNotReleased
from gwt.
Related discussion:
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/c908d345afb514f1/
Reported by gwt.team.vli
on 2006-09-27 17:15:01
from gwt.
Reported by gwt.team.jgw
on 2006-10-31 16:59:58
- Status changed:
Fixed
from gwt.
Reported by [email protected]
on 2008-05-02 02:32:22
from gwt.
Reported by [email protected]
on 2011-02-09 00:10:59
- Labels added: Milestone-1_2-RC
- Labels removed: Milestone-1_2_RC
from gwt.
Related Issues (20)
- Upgrade to HtmlUnit 3.9.0 or 4.1.0 HOT 2
- Upgrade icu4j to a version > 63.1
- Memory leak in stored exceptions HOT 8
- Issue with com.google.gwt.i18n.client.TimeZone in GWT 2.11 for Africa/Cairo Time Zone HOT 4
- Add Java 9 BigInteger methods sqrt and sqrtAndRemainder
- GWT from 2.9 to 2.11 Migration Issue Could not find com.google.gwt:gwt-codeserver:2.11.0. HOT 1
- Remove onLoadErrorFn/onPropertyErrorFn, or make them easier to disable
- Upgrading to GWT 2.10.1 is causing IncompatibleRemoteServiceException HOT 1
- GWT Issue with JDK 17 HOT 1
- Whitespace check inconsistency HOT 2
- closure-compiler build requires extra annotations to scan classes HOT 1
- Annotating an interface method with @JsProperty can produce runtime errors if jsinterop exports are not enabled HOT 1
- java.lang.Math is missing nextUp, nextDown, nextAfter emulation
- Upgrade from gwt 2.0.0 to 2.11.0 erroring out HOT 4
- Create github releases for all past GWT releases HOT 2
- Support private methods in interfaces HOT 4
- HTML 5 Drag and Drop: Impossible to disallow a drop operation in GWT HOT 6
- Provide options for ScriptInjector/CssResource/GssResource to work with CSP headers
- Implement (or document) missing CharSequence methods
- UI component library HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gwt.