Saturday, January 18, 2014

Improving Scrolling Performance in ADF Read-Only Tables with Row Selection Timeout

There is great new feature available in ADF 11g PS6 and ADF 12c - option to enable row selection timeout for ADF read-only tables. By default, when user is pressing up/down keyboard keys - every time row gets selected, even if user is navigating through multiple records, before selecting the one he needs. With row selection timeout enabled, table rows will not be selected while scrolling, until scrolling stops and required record gets selected. This should be default setting, I wonder why Oracle didn't enabled it by default.

I will describe first, how scrolling in ADF read-only tables works by default. For the test purpose, ADF BC method setCurrentRow is overridden to track how many records get selected while navigating with up/down keyboard button:


In order to see output message - make sure to enable ADF logger for Employees VO implementation class:


Select one of the available rows:


You will see row selection action is executed and reported in the log:


Navigate few records down:


You will see in the log, all records were selected - while navigating from the first to the last records:


We can tune this behaviour by enabling row selection timeout, while scrolling with keyboard up/down keys, timeout value will not be exceeded and row will not be selected until user will stop. Select ADF table component:


Change property - SelectionEventDelay, by default it is disabled. This property is available in ADF 11g PS6 or ADF 12c:


Set property SelectionEventDelay to be enabled. Selection timeout is 300 ms, meaning row is selected, if delay between pressing up/down keyboard keys is more than 300 ms:


With SelectionEventDelay = enabled, repeat the same test as above. Select a row in ADF read-only table:


Check in the log - row selection action was invoked:


Navigate few records down and stop:


There will be no records selected in between, only the last one - this will improve ADF read-only table scrolling performance with keyboard up/down keys greatly:


Download sample application - ADFTableScrollingTimeoutApp.zip.

4 comments:

ADF OAF Tech said...

Nice post Andrejus.. Can we apply this to Tree component ?

Andrej Baranovskij said...

Yes, as the same SelectionEventDelay property is available for ADF tree component in 11g PS6 and 12c.

Andrejus

Balaji Kamepalli said...

Hi Andrejus.

I am using Jdevleoper 11.1.2.3.0 , but SelectionEventDelay = enabled property no available in this version.

Do I need any patch or update for this ?

Andrej Baranovskij said...

I think I have mentioned clearly in this post - property is available in ADF 11g PS6 and ADF 12c only.

Not in 11.1.2.x.0

Regards,
Andrejus