Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LayoutPanel don't call onResize #7185

Closed
dankurka opened this issue Jun 10, 2015 · 14 comments
Closed

LayoutPanel don't call onResize #7185

dankurka opened this issue Jun 10, 2015 · 14 comments
Assignees
Milestone

Comments

@dankurka
Copy link
Member

Originally reported on Google Code with ID 7188

Found in GWT Release: 2.4.0

I added a Widget with RequireResize in a LayoutPanel. The onResize Method is only called
on forceLayout or while a animation (but not onCompletion!).
Calling nothing after setWidgetAnyAny(), the onResize-Method is not been called too
(this uses animate(0)).

In animations the onLayout(Layer layout, double process) is not called with process=1.0,
so the onResize is here not called too. (Problem on slow Clients, only getting one
process=0.0 call)

Fix:
layout(0) should call onResize() like forceLayout()

or/and

Call onUpdate(1.0) instead of layout() in Layout.layout(int duration, final AnimationCallback
callback) -> Animation->onComplete (Line540 GWT 2.4.0).

Workarround:
call forceLayout() or add callback on animations like:

myLayoutPanel.animate(duration, new AnimationCallback() {
   @Override
   public void onLayout(Layer layer, double progress) {
   }
   @Override
   public void onAnimationComplete() {
     myLayoutPanel.forceLayout();
   }
 });

Reported by KillerJoe00 on 2012-02-13 13:04:57

@dankurka dankurka self-assigned this Jun 10, 2015
@dankurka
Copy link
Member Author

Hey John,

Any comments on this one?

Reported by rdayal@google.com on 2012-02-17 21:53:46

@dankurka
Copy link
Member Author

Issue 7272 has been merged into this issue.

Reported by t.broyer on 2012-03-26 11:09:17

@dankurka
Copy link
Member Author

Happens in DockLayoutPanel too.

I believe the LayoutCommand's onAnimationComplete should call onResize (which in the
case of LayoutPanel means using a subclass of LayoutCommand to override the onAnimationComplete
method).

Alternatively (and probably better), make Layout#layout() call onResize on each one
of the 'layers' before calling onAnimationComplete (and in the widgets, remove the
explicit call to onResize from the forceLayout methods, as layout.layout() would now
do the equivalent).

Reported by t.broyer on 2012-03-26 11:22:02

  • Status changed: Accepted
  • Labels added: Category-UI

@dankurka
Copy link
Member Author

This is basically the same issue... or at least the fix for one should solve both issues:


http://code.google.com/p/google-web-toolkit/issues/detail?id=5424

Reported by tuckerpmt on 2012-03-26 12:21:40

@dankurka
Copy link
Member Author

Issue 7739 has been merged into this issue.

Reported by t.broyer on 2012-10-22 07:38:13

@dankurka
Copy link
Member Author

Issue 8126 has been merged into this issue.

Reported by t.broyer on 2013-05-08 21:54:39

@dankurka
Copy link
Member Author

The issue is still present in 2.5.1.

Reported by defaveri on 2013-07-12 10:37:09

@dankurka
Copy link
Member Author

Is this related to the contents of tabs in a TabLayoutPanel failing to render in IE6?
I worked around it by programmatically switching tabs in nested scheduled deferred
commands. 

Reported by j.annesley on 2013-08-23 21:57:57

@dankurka
Copy link
Member Author

Attached file fix this problem.

Reported by khmelevskoikg on 2014-08-14 11:02:57


- _Attachment: [Layout.java.diff](https://storage.googleapis.com/google-code-attachments/google-web-toolkit/issue-7188/comment-10/Layout.java.diff)_

@dankurka
Copy link
Member Author

@khmelevskoikg: would you mind submitting this patch to Gerrit?
See http://www.gwtproject.org/makinggwtbetter.html#contributingcode

Reported by t.broyer on 2014-08-18 12:50:52

@timeu
Copy link
Contributor

timeu commented Apr 20, 2016

I ran into that issue again.
I would go ahead and submit khmelevskoikg patch to gerrit if that's ok ?

@tbroyer
Copy link
Member

tbroyer commented Apr 20, 2016

You're taking responsibility of code ownership et al. by doing so, but that's OK as far as I'm concerned.

@timeu
Copy link
Contributor

timeu commented Apr 20, 2016

As long as it doesn't mean that I give away my soul, I should be fine with that ;-)

@timeu
Copy link
Contributor

timeu commented May 2, 2016

@tbroyer tbroyer added this to the 2.8 milestone May 17, 2016
@tbroyer tbroyer closed this as completed May 17, 2016
bauna pushed a commit to bauna/gwt that referenced this issue May 20, 2016
In case of a layout without animation (duration = 0) make sure to call
onLayout with progress set to 1.0 after the layout was computed to make
sure that onResize is properly called.

Bug: gwtproject#7185
Change-Id: Ieb0ebb2eeb055ad18ee84db23f4f5f786c107f45
Bug-Link: gwtproject#7185
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants