Author Topic: Cached scrolling  (Read 9960 times)

m2med

  • Newbie
  • *
  • Posts: 17
    • View Profile
Cached scrolling
« on: August 21, 2015, 10:39:47 AM »
How do we enable caching of a JScrollPane. For example there is a screen with a large form that uses the Swing scroll bar and is extremely slow to scroll because we need to make the ajax request with the new HTML elements each time. I have tried BLIT and BACKING_STONE modes and that didn't seem to help. This seems to happen with JTables. There is a JViewport with every component inside and lets the browser handle the scrolling. I also noticed if I don't change any of the Swing code, but remove a large number of fields from the View it caches properly. I have tried setting the clip size of the graphics component, but it does not seem to have any effect on the output.

Any ideas? Thanks!

m2med

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Cached scrolling
« Reply #1 on: August 21, 2015, 10:50:52 AM »
Just to be clear the JTable example properly caches all of the HTML elements to the browser

m2med

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Cached scrolling
« Reply #2 on: August 21, 2015, 11:32:56 AM »
In fact it appears to be directly related to some maximum size somewhere. If I make the browser window very short but wide I get the functionality of cached elements, but if I enlarge the browser and let more fields be shown at once I receive the slow Ajax style panel

m2med

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Cached scrolling
« Reply #3 on: August 21, 2015, 11:37:11 AM »
And to add another update it appears to be width related. If the window is small in width we get the bad style, large gives caching. It may be related to the layout manager, but is there any information you have on what might be happening?

Support Team

  • Administrator
  • Hero Member
  • *****
  • Posts: 1074
    • View Profile
Re: Cached scrolling
« Reply #4 on: August 21, 2015, 02:42:51 PM »
AjaxSwing can switch to "dynamic" scrolling on the client depending on the content size. You can override this behavior, see

http://www.creamtec.com/products/ajaxswing/doc/AppProperties.html#window_reference.component_reference.isClientSideScrolling

Let us know if that's what you were looking for.

m2med

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Cached scrolling
« Reply #5 on: August 21, 2015, 03:11:58 PM »
AjaxSwing can switch to "dynamic" scrolling on the client depending on the content size. You can override this behavior, see

http://www.creamtec.com/products/ajaxswing/doc/AppProperties.html#window_reference.component_reference.isClientSideScrolling

Let us know if that's what you were looking for.

That is exactly what I was looking for! Apologizes for missing that in the docs

m2med

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Cached scrolling
« Reply #6 on: August 24, 2015, 08:27:45 AM »
That setting appeared to help significantly in the sense that the browser was being sent the items an cached them for client side scrolling, but it still seems to be very inconsistent. At certain aspect ratios and browsers are still only being sent a few of the HTML elements and fall back to server side scrolling. Is there something else that should be done to enforce the rule?

Support Team

  • Administrator
  • Hero Member
  • *****
  • Posts: 1074
    • View Profile
Re: Cached scrolling
« Reply #7 on: August 25, 2015, 01:35:19 PM »
Could you provide screenshots of how it looks in normal/"cached" mode?

m2med

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Cached scrolling
« Reply #8 on: August 25, 2015, 02:43:27 PM »
Note the scroll bar on the right hand side. In the cached image the scroll bar is created by chrome on the client machine

Support Team

  • Administrator
  • Hero Member
  • *****
  • Posts: 1074
    • View Profile
Re: Cached scrolling
« Reply #9 on: August 26, 2015, 05:36:36 AM »
I see. I'll need some time to create a test app, to reproduce this issue locally.
Also we enable "cached" scrolling if the height or wight is more than 2200 px.
Could you provide your app's properties file?

m2med

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Cached scrolling
« Reply #10 on: August 26, 2015, 10:39:20 AM »
Code: [Select]
#AjaxSwing properties file
#Wed Jul 15 09:04:33 EDT 2015
applet.height=700
applet.width=1200
agent.allowLFChange=true
router.inProcess=false
router.clientsPerJVM=1

.. Other app specific code like launching applet class.

component.javax.swing.JViewport.isClientSideScrolling=true
component.com.ui.UiViewport.isClientSideScrolling=true
component.javax.swing.JScrollPane.isClientSideScrolling=true
component.com.ui.UiScrollPane.isClientSideScrolling=true
component.com.ui.UiPopupWindow.undecorateWindow=com.gbahn.ui.UiPopupWindow