Threaded View

  1. #1
    Sencha User
    Join Date
    Jun 2010
    Vote Rating
    baze is on a distinguished road


    Default Answered: How to manually call resize on a changed Viewport

    Answered: How to manually call resize on a changed Viewport

    Hi all,

    I spent about 3-4 hours fighting with this, and maybe someone can point me what Im missing!

    I use extgwt(its un older project) and I have extended the Viewport which dose window resize tracking
    in a class like this

    public class MainFrame extends Viewport {

    final BorderLayout layout = new BorderLayout();

    code where border layout components are added

    public void fireMainViewResize(){
    // onWindowResize(Window.getClientWidth(), Window.getClientHeight());


    In one of the components, which is added in the viewport as a BorderLayout.Left, on runtime(after initial show) I add some child components and this makes perent component to incrise in its y size. This is all expected. After this I want to re-draw the component so it can addopt to this new size and fit the viewport size again.

    I tried calling layout, layout(force=true) but dose nothing.
    Then I tried calling window resize on the Viewport with a layout(force), also nothing.

    If I manualy resize the browser all get adopted to the viewport size, so I cannot find out what else is actually called when the browser is relly resized.

    I did a try to call all the related Window.resizeHandlers by jsni methods because they are not visible,
    once like this:

    private native void fireManulaWindowResize() /*-{
    try {
    $wnd.console.log("fireManulaWindowResize start");
    $wnd.onresize(new Object());
    $wnd.console.log("fireManulaWindowResize end");

    } catch (err){
    $wnd.console.log("Error on manual call for resize: " + err);


    and like this

    private native void fireManulaWindowResize() /*-{
    try {
    $wnd.console.log("fireManulaWindowResize start");;
    $wnd.console.log("fireManulaWindowResize end");

    // $wnd.alert("$wnd.resized");

    } catch (err){
    $wnd.console.log("Error on manual call for resize: " + err);


    No exception in the calles, but the added handleres are never executed...

    Someone idea on how to force the viewport to re-renderer(re-calculate) its children sizes and paint again?

    Tnx for any idea,

  2. Ok after a lot of fight, I found a solution.
    The size for the component was somehow counted as not changed.
    With a call to getOffsetHeigt() to remember the height before adding new components, and setting the same size after with a calling to layout(force) did the job. Seems like the size was not tracked correct in the listeners...

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi