From: Richard B. <ric...@us...> - 2001-10-25 16:25:45
|
Update of /cvsroot/dynapi/dynapi/tests In directory usw-pr-cvs1:/tmp/cvs-serv13664 Added Files: link_and_form_events_NS4.html Log Message: testpage, to check mouse+keyboard events keep working in NS4 --- NEW FILE --- <html> <head> <title>Test Page - Layer.Forms</title> <script language="Javascript" src="../src/dynapi.js"></script> <script language="Javascript"> DynAPI.setLibraryPath('../src/lib/') DynAPI.include('dynapi.api.*') DynAPI.include('dynapi.event.listeners.js') DynAPI.include('dynapi.event.mouse.js') DynAPI.include('dynapi.event.keyboard.js') </script> <script language="Javascript"> DynAPI.onLoad=function(){ myLayer=new DynLayer(null,135,120,220,180) myLayer.setBgColor('#cccccc') myLayer.setHTML(htmlcode) // when an event listener is added // form elements stop responding to events e= new EventListener() e.onclick=function(e,control){ alert("in myLayer.onclick") } myLayer.addEventListener(e) DynAPI.document.addChild(myLayer) myListener = new EventListener(DynAPI.document) myListener.onkeyup=function(e) { if (e.charKey=='s') alert('You\'ve found the secret key') if ((e.charKey>='a')&&(e.charKey<='z')) alert('You pressed the key \''+e.charKey+'\'.') } myListener.onkeydown=function(e) { if (e.ctrlKey) { myLayer.moveBy(20,20);return true } if (e.shiftKey) alert('SHIFT!') } DynAPI.document.addEventListener(myListener) } var htmlcode='<form name=myform><table border="0" cellspacing="1">' htmlcode+='<tr><td><font face="Arial" size="2">Name</font></td>' htmlcode+='<td><input onchange="alert(\'change\')" type=text size="15" name="fname"></td></tr>' htmlcode+='<tr><td><font face="Arial" size="2">Address</font></td>' htmlcode+='<td><input onchange="alert(\'change\')" type=text size="15" name="address"></td></tr>' htmlcode+='<tr><td colspan="2"><font face="Arial" size="2"><input onclick="alert(\'click\')" type=radio name="gender" value="male">Male </font>' htmlcode+='<input onclick="alert(\'click\')" type=radio name="gender" value="female"><font face="Arial" size="2">Female</font></td></tr>' htmlcode+='<tr><td colspan="2" align="right"><input onclick="alert(\'click\')" type=button name=cmd value=Button></td></tr>' htmlcode+='</table></form><a href="#" onclick="alert(\'click\')">click here test the onclick event</a>' </script> </head> <body> <font size=2 face=arial><b>Issue:</b> In NS4 form elements do not respond to mouse or keyboard events.<br> This issue only occurs when the mouse.js and keybord.js events are included and an event listener is added to the layer. The same goes for hyperlinks <br /><b>[update 25/Oct/2001]</b> <br />As of now this issue should be fixed. <br />A keyevent has been added to the DynAPI.document, and an onclick event to the DynLayer for testing. <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <b>Discrepancies: (tested on win2000)</b> <br /><br />IE: <br />The DynAPI onclick event is caught by all form elements on the DynLayer. <br />The DynAPI onkeyup event is caught at all times. <br />The textbox' change event is caught when changing focus to another element. <br /><br />NS4: <br />The DynAPI onclick event is <b>only caught by the hyperlink, and the DynLayer</b>. <br />The DynAPI onkeyup <b>event is not caught when a form element has the focus</b>. <br />The textbox' change event is caught when changing focus to another element. <br /><br />Mozilla (NS6): <br />The DynAPI onclick event is caught by all form elements on the DynLayer. <br />The DynAPI onkeyup event is caught at all times. <br />The textbox' change event is caught <b>on each keyup</b>. <br /> </font> </body> </html> |