From: Carsten M. <ca...@au...> - 2001-07-16 11:29:13
|
Hello! I'm a real novice with the DynAPI and trying to implement a Popup-menu with the AfroAPI-extension. I've got the Popup example from this list, but it doesn't work. IE 5+ and Netscape 4.5+ giving some erros: 'group is undefined' at start and 'is is undefined' at unload. This is the JavaScript-Code (from the example): <SCRIPT LANGUAGE=3D"JavaScript" SRC=3D"dynapi/dynapi.js"></SCRIPT> <SCRIPT LANGUAGE=3D"JavaScript"> <!-- DynAPI.setLibraryPath('dynapi/lib/'); DynAPI.include('afroapi.api.*'); DynAPI.include('afroapi.events.mouse'); DynAPI.include('afrogui.core.style'); DynAPI.include('afrogui.core.cell'); DynAPI.include('afroapi.ext.layer'); DynAPI.include('afrogui.widgets.popup'); myListener =3D new EventListener(DynAPI.document); =09myListener.onmousedown=3DmyListener.onrtmousedown=3Dfunction(e) { =09=09myPopUp.Collapse(); =09=09e.cancelBrowserEvent(); =09}; myListener.onrtmouseup=3Dfunction(e) { myPopUp.Pop(e.getX(), e.getY()); }; =09DynAPI.theme=3Dnew DynStyle(); =09DynAPI.theme.scheme.face=3D'#D4D0C8'; =09DynAPI.theme.scheme.light=3D'#ECE8E3'; =09DynAPI.theme.scheme.dark=3D'#9E8A76'; =09DynAPI.theme.font.bold=3Dfalse; =09DynAPI.theme.font.size=3D2; =09DynAPI.theme.font.family=3D'tahoma'; =09DynAPI.theme.scheme.bgSelected=3D'#A0C8EF'; myPopUp =3D new PopUp(100); =09myPopUp.add('Back',null,'javascript:history.back()','Return to previous= page in history list'); =09myPopUp.add('Forward',null,'javascript:history.forward()','Move forward= to next page in history list'); =09myPopUp.add('Reload',null,'javascript:location.replace(location.href)',= 'Reload the current page'); =09myPopUp.add('-'); =09myPopUp.add('View Source',null,'view-source:'+location.href,'View the s= ource of the current page'); =09DynAPI.onLoad=3Dfunction() { =09=09DynAPI.document.addChild(myPopUp); =09=09DynAPI.document.addEventListener(myListener); =09}; function show_popup() { xpos =3D event.clientX; ypos =3D event.clientY; myPopUp(); } //--> </SCRIPT> Carsten @ugenblick! - Softwaredevelopment & Web-Design Ledeburstr. 15 - 33102 Paderborn - Germany fon 049 (0)5251 282698 - mobile 049 (0)173 2714396 http://www.augenblick-software.de mailto:ca...@au... |