• clicking on list item in List Text Box or Name Text Box trigger onbeforeunload in IE

    By Richard G Irwin 1 decade ago

    I originally posted about this in the discussion forum last August but never posted a defect. As I just had to reapply my patches when upgrading to Domino 9, I figured I should try to get it into the source.

     

    When an onbeforeunload function is defined, in Inernet Explorer clicking on a link rendered by a ListTextBox, LinkSelect or ImageSelect will trigger that function even though you are not attempting to navigate away from the page. This happens because the href for these links are "javascript:;". Most rendered links that trigger javascript in other xpage controls use an href of "#" and this does not trigger the onbeforeunload event. This will affect any control based on these components as well, such as Dojo Name Text Box.

     

    I recommend patching the files _ListTextBox.js, LinkSelect.js and ImageSelect.js be patched as follows:

     

    64c64 (line numbers are different on each file)
    
    <  href: 'javascript:;',
    
    ---
    
    >  href: '#',
    
     
    
    • Sample? More Info

      By Darin Egan 1 decade ago

      Richard,

      Could you provide some sample source code and description regarding the solution you are creating.

      Furthermore, I would refer you to the MSDN beforeunload event below. You will note that there are a number of actions which cause this event to be invoked.

      http://msdn.microsoft.com/en-us/library/ie/ms536907