Opened 14 years ago

Closed 14 years ago

#1453 closed defect (duplicate)

Inherit annotations - parents not displayed without 1st clicking Annotations & parameters tab

Reported by: Johan Vallon-Christersson Owned by: everyone
Priority: major Milestone:
Component: web Version:
Keywords: Cc:

Description

When editing an item (in this example a sample), the tab displayed when the pop-up opens will be the tab last viewed, e.g., 'Inherited annotations' tab. If 'Inherited annotations' tab is displayed when pop-up opens, annotations (for parents) will not load and the dialogue will show 'no parents with annotations' (Picture 6). You must then click the 'Annotations & parameters' tab to load annotations (Picture 7). If you then revisit the 'Inherited annotations' tab it will display parents with annotations (Picture 8).

Attachments (3)

Picture 6.png (25.6 KB ) - added by Johan Vallon-Christersson 14 years ago.
Picture 7.png (20.3 KB ) - added by Johan Vallon-Christersson 14 years ago.
Picture 8.png (28.1 KB ) - added by Johan Vallon-Christersson 14 years ago.

Download all attachments as: .zip

Change History (8)

by Johan Vallon-Christersson, 14 years ago

Attachment: Picture 6.png added

by Johan Vallon-Christersson, 14 years ago

Attachment: Picture 7.png added

by Johan Vallon-Christersson, 14 years ago

Attachment: Picture 8.png added

comment:1 by Nicklas Nordborg, 14 years ago

I am not able to reproduce this. Could it perhaps be a browser issue? I am currently using Firefox 3.6 on Windows.

in reply to:  1 comment:2 by Johan Vallon-Christersson, 14 years ago

Replying to nicklas:

I am not able to reproduce this. Could it perhaps be a browser issue? I am currently using Firefox 3.6 on Windows.

I'm using Firefox 3.6 on Mac. I'll try some more (additional samples) and see if behavior is persistent.

comment:3 by Nicklas Nordborg, 14 years ago

It works without problem also with Firefox 3.5.7 on Linux.

comment:4 by Nicklas Nordborg, 14 years ago

This could be a race condition between two scripts on the page. There is one script attached to the onLoad() event that initializes the form with parent information (and some other things). There is also one inline script that is calling switchTab() to make sure the proper tab is selected. This script is marked with 'defer'. If the page should work as expected the onLoad() script must finish before the switchTab() script is executed. But it is unclear how browsers handle this and it may not be consistent between different browsers. I found an article that advices against relying on the 'defer' attribute: http://peter.michaux.ca/articles/the-window-onload-problem-still

I guess we need to solve this in a different way. I also know that there are other scripts that use 'defer' and we should to search our code and fix it.

comment:5 by Nicklas Nordborg, 14 years ago

Resolution: duplicate
Status: newclosed

I have made some tests to find out in which order the switchTab() and init() methods are executing. It turns out that switchTab() is executed before init() which is a bit surprising because it means that the parent items has not been initialized in the form when the switch to the "Inherited annotations" tab is made. Yet, I was unable to reproduce the problem but I now realize that this issue is caused by the same bug as #1454. Since the switchTab() request doesn't have any information about parent items the page that displays the parent items revert to getAnnotatableParents() which doesn't return the expected results under the conditions described in #1454. Then, when the user clicks a different tab and then back again to the "Inherited annotations" tab, the form has been initialized and the parent information is available in the request and the page uses this information in addition to getAnnotatableParents().

Thus, the fix for #1454 should have fixed this problem as well... but... I still think we should reconsider the use of the 'defer' attribute for the switchTab() part of the script. The propert order is that init() is executed first and then switchTab().

I'll close this ticket as duplicate of #1454 and open a new ticket for the 'defer' removal.

Note: See TracTickets for help on using tickets.