eventHandling.html

<HTML>

<HEAD>

<script>var dFrameFilePath = '../../../'</script>

<script language="Javascript" src="../../../lib/dFrameAPI.js"></script>

<script language="Javascript">

//Style

DFrameAPI.include('styles/blue/styleBlue.js')

//globals

var baseAll, dFrameRight

DFrameAPI.onLoad = function(){

baseAll = new DFrame([0, 0, 100, 100], 'baseAll', dFrameStyle)

baseAll.addButton('Insert eventHandling.html', 'insertPage("./advanced.eventHandling.html")');

baseAll.addButton('Insert test event.html', 'insertPage("./advanced.eventHandling/testEvent.html")');

events = new DFrame([2, 2, 50, 98], 'events', dFrameStyle, baseAll);

baseAll.onEvent = function(e) {

if (e.dFrame.title != 'events') events.addAlert('<font size=1 face=Arial>' + e.eventID + ' - ' + e.action + ' - ' + e.dFrame.title)

if (e.dFrame == baseAll && e.action == 'postCreate') {

if (e.dFrame.getParentDFrame() == null) e.dFrame.setTitle('FIRST container')

else e.dFrame.setTitle('SUB container')

e.cancelBubble = true

events.addAlert('<font size=1 face=Arial>' + e.eventID + ' - ' + e.action + ' - ' + e.dFrame.title + ': bubbling cancelled')

}

if (e.dFrame == dFrameRight && e.action == 'postCreate') {

var p = e.dFrame.getParentDFrame()

if (p == null) alert('Never happend: dFrameRight has always a parent')

else e.dFrame.setTitle('SUB of ' + p.title)

e.cancelBubble = true

events.addAlert('<font size=1 face=Arial>' + e.eventID + ' - ' + e.action + ' - ' + e.dFrame.title + ': bubbling cancelled')

}

}

baseAll.show()

}

function insertPage(url) {

if (!dFrameRight) {

dFrameRight = new DFrame([52, 2, 98, 98], 'dFrameRight', dFrameStyle, baseAll);

}

dFrameRight.setURL(url)

}

</script>

</HEAD>

</HTML>