Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    HTMLPane loading images - height problem

    There is problem in HTMLPane with images.

    SmartGWT 3.1, Mozilla FF or Chrome or IE9:

    HTMLPane works fine when i do not have any img's inside. I put content to HTMLPane not as a website, but it is a still HTML content.

    When i got <img> tags and some image src defined especially on the end of content, after HTMLPane loads it the <img> is not visible or it is partially visible, because you can not scroll down the HTMLPane. So basically it looks like HTMLPane loads correctly but it does not recalculate the height after imgs are loaded.

    ----

    Everything is working fine after the imgs are cached in browser. Then it works fine and HTMLPane height calculations are ok.
    Last edited by jarekevi; 9 May 2013, 01:14. Reason: more info to subject

    #2
    Before the images are loaded, the browser does not know the size of the content, so gives us a bad size.

    There are a couple of approaches to get this right:

    1. if you can adjust the HTML so that sizes are placed explicitly on the images, the browser will report the right size before the images are loaded

    2. you can wait until the images are loaded and call adjustForContent() on the HTMLFlow.

    Comment


      #3
      Need to refresh this subject. Because it is still not working in the proper way.

      Problem is that I do not know the image height before I load content. I need the HTMLPane to redraw after content is fully loaded.

      There is no problem if images are cached.

      Question is: can you show me some other solution, I dont know maby some on Load function ? After all imgs are loaded ?

      both:
      Code:
      adjustForContent(false);
      // or
      adjustForContent(true);
      do not work

      I attached png to show exact problem, but I think you know the issue.
      Attached Files

      Comment


        #4
        You can use GWT's Image class to detect whether images are loaded (or load them).

        Comment


          #5
          We are facing the same problem again.

          HTMLPane does not recalculate itself in height. Can I trigger recalculaion of scrollbar ?

          Problem took us hours of figure out how to make simple show/hide panel inside HTMLPane to content loaded dynamicly.

          Besides IMGs (which we dropped months ago - because we werent able to manage). What goods is I can detect loading if I cant recalculate scroll ?

          I manage to make panel dynamic show/hide box when I setup evalScriptBlocks to true, but script can not be evaluated inline, it always shows up at the bottom of the content, and more... it does not desappear after HTMLPane setContents is changed. (loaded again).


          Here is my problem:

          1. I got HTMLPane and I want to setContent in it.
          2. Inside that content I got a div which is not displayed
          3. I want to show the div with the content after user will click on small box above div and make HTMLPane recalculate scrolls

          When I do "redraw()" or "markForRedraw" it's not displayed again... because it shows classes (styles) of CSS which I put on the very begin.

          When I use native isc for smartClient. isc.Canvas (as my div) :
          1. it renders after content not inline
          2. its not cleared when I put new content in HTMLPane

          If anything above is not cleared for you with my explanation. Please write as soon as posible. This is extremally important for us to make it work. I can provide - code, screenshoots anything. Just want this to work as it should be.

          Comment


            #6
            We already covered this in our first reply: if you directly change the content in any way outside of SmartClient's API (direct CSS class change in the DOM, insert new content, etc), call adjustForContent().

            Comment

            Working...
            X