Announcement

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

    Base64-encoded stateful images

    SmartClient Version v9.1p_2014-05-27/Enterprise nightly build of (2014-05-27)

    Chrome 35.0.1916.114 m

    We have a problem with listgrid records that are automatically updated with fresh data every few seconds which causes all images in the listgrid (such as "GroupIcon") to flicker with each refresh.
    We've worked around this problem by using base64 encoding where possible:
    Code:
    ...
    expansionFieldTrueImage:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u...
    ...
    This becomes an issue with stateful buttons such as the 'GroupIcon', where '_opened' & '_closed' gets appended to the image reference, destroying the the encoded string.

    Is there some way to either assign a base64 string each state directly, similar to "ListGrid.expansionFieldTrueImage/ListGrid.expansionFieldFalseImage", or maybe assign a class name that can then be addressed in the css?

    Thanks in advance for any help or advice

    #2
    What we'd recommend that you actually do is fix the flicker issue the right way - it suggests that you are not setting HTTP expires headers properly on the images being loaded from the server.

    Failing to set expires headers will greatly degrade your overall application performance, and the flickering is just the most obvious symptom.

    Note that expires headers are automatically correctly set if you are using the SmartClient Server Framework (specifically by the FileDownload servlet).

    Note also that if you've explicitly disabled caching on your browser for development purposes, this might cause the browser to ignore Expires headers, which means you may be seeing an effect that no end user would ever see.

    Comment

    Working...
    X