High dynamic adjustment of a vLayout

0

I have a problem using GWT the general problem is that I am inserting a resource using the URL in an HTMLFlow where I give the url of the resource

    htmlPage = new HTMLFlow();    
    htmlPage.setContentsURL(urlPage);

    ....

    vLayout panel = new VLayout();
    panel.add(htmlPage);

The problem with this is that if the htmlPage object does not stop, when the content of the URL is loaded, that content is not displayed.

The idea is that the vLayout automatically adjusts to the high content within htmlPage.

    
asked by Felipe Nuñez 08.04.2016 в 17:46
source

1 answer

1

Do you need to enter the HTMLFlow within vLayout for something? If it is not necessary, the solution is as easy as doing the following and forgetting the vLayout .

htmlPage = new HTMLFlow();    
htmlPage.setContentsURL(urlPage);
htmlPage.show();

If you need the vLayout because later you are going to add more widgets apart from this HTMLFlow you will have to take into account the following:

  

NOTE: Since the size of an HTMLFlow component is determined by its   HTML contents, this component will draw at varying sizes if given   content of varying size When using HTMLFlow components within a   Layout, consider what will happen if the HTMLFlow renders at various   sizes. An HTMLFlow which can expand should be placed in a container   where other components can render smaller, where the container is   allowed to scroll, or where there is padding to expand into.    HTMLFlow Documentation

The easiest solution would be to tell the vLayout what it has to measure, get the HTMLFlow and let the vLayout scroll if the content gets too big.

Something like this:

htmlPage = new HTMLFlow();    
htmlPage.setContentsURL(urlPage);
vLayout panel = new VLayout();
panel.setHeight("100%");
panel.setOverflow(Overflow.AUTO);
panel.add(htmlPage);
panel.show();
    
answered by 04.07.2016 в 13:01