FLUID-2780: Clicking on either of the last two page links will throw an error

Metadata

Source
FLUID-2780
Type
Bug
Priority
Blocker
Status
Closed
Resolution
Fixed
Assignee
N/A
Reporter
Justin Obara
Created
2009-05-27T10:27:08.000-0400
Updated
2009-05-27T14:01:00.000-0400
Versions
N/A
Fixed Versions
  1. 1.1
Component
  1. Pager

Description

Clicking on either of the last two page links will throw an error

Steps to reproduce:

1) Open the Sakai Site Settings example
http://build.fluidproject.org/infusion/integration-demos/sakai/html/pager-site-setting.html#

2) Click on either the last or second last page link

Notice that an error is thrown

Error:
fluid.jById(lastId).focus is not a function
http://build.fluidproject.org/infusion/framework/renderer/js/fluidRenderer.js

Another way to generate this error:

Environments

FF2, FF3, Opera 9.6, Safari 3.2 (Mac OS 10.5)
Safari 3.2 (Mac OS 10.4)
FF2, FF3, IE6, IE7, IE8, Opera 9.6 (Win XP)
FF3, IE7, IE8 (Win Vista)
IE6 (Win 2000)

Attachments

Comments

  • Antranig Basman commented 2009-05-27T13:19:05.000-0400

    Attached patch which guards against this issue twice - There are two parts to this problem.

    Firstly, the ids assigned to the page links in this case are not assigned stably, so the last 3 links in general will not have corresponding ids once the page link control is rerendered. This is now handled by setting the "localID" property for the control which now stably associates its id with the page number to which it corresponds.

    Secondly, this error should not be thrown under any circumstances, even if the element to be focused no longer exists. So the relevant code in the renderer is now guarded.

  • Justin Obara commented 2009-05-27T14:01:00.000-0400

    Verified fix using:

    FF2, FF3, Opera 9.6, Safari 3.2 (Mac OS 10.5)
    FF3, IE7, IE8 (Win Vista)