I am trying to create a property inspector extension for a data translator
extension and I am running into a problem. Property inspector doesn't seem to
be recognizing onclick or onchange events. The only event that seems to be
working is the onblur event. My property inspector displays ok and can even get
the data from my data translator. The last piece of the puzzle is getting the
correct events working so that I may change the data. Below is my code that
should illustrate the problem.

<!-- tag:*LOCKED*,priority:10,selection:exact -->
<!DOCTYPE HTML SYSTEM "-//Macromedia//DWExtension layout-engine5.0//pi">
<HTML>
<HEAD>
<TITLE>Interjection Inspector</TITLE>
<SCRIPT LANGUAGE="JavaScript">

function canInspectSelection()
{
//return true;
var theDOM = dw.getDocumentDOM();
var theObj = theDOM.getSelectedNode();
//alert((theObj.nodeType == Node.COMMENT_NODE &&
theObj.outerHTML.indexOf("<!--#datagrid") == 0));
//alert(theObj.nodeType == Node.COMMENT_NODE);
//alert(theObj.nodeType);
//alert(theObj.outerHTML.indexOf("<!--#datagrid") == 0);
return (theObj.nodeType == Node.ELEMENT_NODE &&
theObj.outerHTML.indexOf("<!--#datagrid") == 0);

}

function inspectSelection()
{
// // Get the DOM of the current document var
// theDOM = dw.getDocumentDOM();
// // Get the selected node
// var theObj = theDOM.getSelectedNode();
// //alert(theObj.outerxml);
// if(theObj == null)
// alert('null');
// else
// alert(theObj.tagName);

var currentDOM = dw.getDocumentDOM();
var curSelection = currentDOM.getSelection();
var theObj = currentDOM.offsetsToNode(curSelection[0],curSelection[0]+1);

if (theObj.nodeType != Node.ELEMENT_NODE)
return;

// To convert the encoded characters back to their
// original values, use the unescape() method.
var origAtt = unescape(theObj.getAttribute("ORIG"));

// alert(origAtt);
// // Convert the string to lower case for processing
// var origAttLC = origAtt.toLowerCase();

// var tableclassStart = origAttLC.indexOf('tableclass="');
// var tableclassEnd = origAttLC.indexOf('"',tableclass+6);
// var tableclassValue = origAtt.substring(tableclass+6,tableclassEnd);

// var timeStart = origAttLC.indexOf('time="');
// var timeEnd = origAttLC.indexOf('"',timeStart+6);
// var timeValue = origAtt.substring(timeStart+6,timeEnd);

// var timeStart = origAttLC.indexOf('time="');
// var timeEnd = origAttLC.indexOf('"',timeStart+6);
// var timeValue = origAtt.substring(timeStart+6,timeEnd);

// var timeStart = origAttLC.indexOf('time="');
// var timeEnd = origAttLC.indexOf('"',timeStart+6);
// var timeValue = origAtt.substring(timeStart+6,timeEnd);

// var timeStart = origAttLC.indexOf('time="');
// var timeEnd = origAttLC.indexOf('"',timeStart+6);
// var timeValue = origAtt.substring(timeStart+6,timeEnd);

// var timeStart = origAttLC.indexOf('time="');
// var timeEnd = origAttLC.indexOf('"',timeStart+6);
// var timeValue = origAtt.substring(timeStart+6,timeEnd);

// var timeStart = origAttLC.indexOf('time="');
// var timeEnd = origAttLC.indexOf('"',timeStart+6);
// var timeValue = origAtt.substring(timeStart+6,timeEnd);

var form = document.topLayer.document.topLayerForm;//layers['timelayer']
// set the tableclass
var tableclassValue =
origAtt.replace(/(^<!--#datagrid.*tableclass\s*=\s*)(['\"])([\s!#$%&\\(-j=?-~]*)
\2(.*-->$)/g, "$3");
if(tableclassValue == origAtt)
form.tableclass.value = "";
else
form.tableclass.value = tableclassValue;
// set the inputclass
var inputclassValue =
origAtt.replace(/(^<!--#datagrid.*inputclass\s*=\s*)(['\"])([\s!#$%&\\(-j=?-~]*)
\2(.*-->$)/g, "$3");
if(inputclassValue == origAtt)
form.inputclass.value = "";
else
form.inputclass.value = inputclassValue;
// set the trclass
var trclassValue =
origAtt.replace(/(^<!--#datagrid.*trclass\s*=\s*)(['\"])([\s!#$%&\\(-j=?-~]*)\2(
..*-->$)/g, "$3");
if(trclassValue == origAtt)
form.trclass.value = "";
else
form.trclass.value = trclassValue;
// set the selectclass
var selectclassValue =
origAtt.replace(/(^<!--#datagrid.*selectclass\s*=\s*)(['\"])([\s!#$%&\\(-j=?-~]*
)\2(.*-->$)/g, "$3");
if(selectclassValue == origAtt)
form.selectclass.value = "";
else
form.selectclass.value = selectclassValue;
// set the thclass
var thclassValue =
origAtt.replace(/(^<!--#datagrid.*thclass\s*=\s*)(['\"])([\s!#$%&\\(-j=?-~]*)\2(
..*-->$)/g, "$3");
if(thclassValue == origAtt)
form.thclass.value = "";
else
form.thclass.value = thclassValue;
// set the optionclass
var optionclassValue =
origAtt.replace(/(^<!--#datagrid.*optionclass\s*=\s*)(['\"])([\s!#$%&\\(-j=?-~]*
)\2(.*-->$)/g, "$3");
if(optionclassValue == origAtt)
form.optionclass.value = "";
else
form.optionclass.value = optionclassValue;
// set the tdclass
var tdclassValue =
origAtt.replace(/(^<!--#datagrid.*tdclass\s*=\s*)(['\"])([\s!#$%&\\(-j=?-~]*)\2(
..*-->$)/g, "$3");
if(tdclassValue == origAtt)
form.tdclass.value = "";
else
form.tdclass.value = tdclassValue;
// set the efleft
var efleftValue =
origAtt.replace(/(^<!--#datagrid.*efleft\s*=\s*)(['\"])([\s!#$%&\\(-j=?-~]*)\2(.
*-->$)/g, "$3");
if(efleftValue == origAtt)
form.efleft.removeAttribute('CHECKED');
else
{
if(efleftValue == "1")
form.efleft.setAttribute('CHECKED', 'checked');
else
form.efleft.removeAttribute('CHECKED');
}
}

function tableclass_onchange()
{
var val = document.topLayer.document.topLayerForm.tableclass .value;
alert('tableclass' + val);
// Get the DOM of the current document
var theDOM = dw.getDocumentDOM();
// Get the selected node
var theObj = theDOM.getSelectedNode();
theObj.setAttribute('tableclass', val);
}

function inputclass_onchange()
{
var val = document.topLayer.document.topLayerForm.inputclass .value;
alert('inputclass' + val);
// Get the DOM of the current document
var theDOM = dw.getDocumentDOM();
// Get the selected node
var theObj = theDOM.getSelectedNode();
theObj.setAttribute('inputclass', val);
}

function trclass_onchange()
{
var val = document.topLayer.document.topLayerForm.trclass.va lue;
alert('trclass' + val);
// Get the DOM of the current document
var theDOM = dw.getDocumentDOM();
// Get the selected node
var theObj = theDOM.getSelectedNode();
theObj.setAttribute('trclass', val);
}

function selectclass_onchange()
{
var val = document.topLayer.document.topLayerForm.selectclas s.value;
alert('selectclass' + val);
// Get the DOM of the current document
var theDOM = dw.getDocumentDOM();
// Get the selected node
var theObj = theDOM.getSelectedNode();
theObj.setAttribute('selectclass', val);
}

function thclass_onchange()
{
var val = document.topLayer.document.topLayerForm.thclass.va lue;
alert('thclass' + val);
// Get the DOM of the current document
var theDOM = dw.getDocumentDOM();
// Get the selected node
var theObj = theDOM.getSelectedNode();
theObj.setAttribute('thclass', val);
}

function optionclass_onchange()
{
var val = document.topLayer.document.topLayerForm.optionclas s.value;
alert('optionclass' + val);
// Get the DOM of the current document
var theDOM = dw.getDocumentDOM();
// Get the selected node
var theObj = theDOM.getSelectedNode();
theObj.setAttribute('optionclass', val);
}

function tdclass_onchange()
{
var val = document.topLayer.document.topLayerForm.tdclass.va lue;
alert('tdclass' + val);
// Get the DOM of the current document
var theDOM = dw.getDocumentDOM();
// Get the selected node
var theObj = theDOM.getSelectedNode();
theObj.setAttribute('tdclass', val);
}

function efleft_onclick()
{
var val = document.topLayer.document.topLayerForm.efleft.val ue;
alert('efleft ' + val);
}

</SCRIPT>
</HEAD>
<BODY>
<SPAN ID="topLayer" STYLE="position:absolute; z-index:1;
left: 125px; top: 3px; width: 431px; height: 32px">
<FORM NAME="topLayerForm">
<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="1">
<TR>
<TD NOWRAP>Table Class</TD><TD><INPUT TYPE='TEXT' NAME='tableclass'
onChange='tableclass_onchange()'/></TD>
<TD NOWRAP>Input Class</TD><TD><INPUT TYPE='TEXT' NAME='inputclass'
onblur='inputclass_onchange()'/></TD>
<TD NOWRAP><INPUT TYPE='CHECKBOX' NAME='efleft' onclick='onChange'>Editable
fields to the left</INPUT></TD>
</TR>
<TR>
<TD NOWRAP>Table Row Class</TD><TD><INPUT TYPE='TEXT' NAME='trclass'
onblur='trclass_onchange()'/></TD>
<TD NOWRAP>Select Class</TD><TD><INPUT TYPE='TEXT' NAME='selectclass'
onblur='selectclass_onchange()'/></TD>
<TD NOWRAP><INPUT TYPE='BUTTON' VALUE='Edit Mutable Columns'
onclick='efleft_onclick'/></TD>
</TR>
<TR>
<TD NOWRAP>Table Header Class</TD><TD><INPUT TYPE='TEXT' NAME='thclass'
onblur='thclass_onchange()'/></TD>
<TD NOWRAP>Option Class</TD><TD><INPUT TYPE='TEXT' NAME='optionclass'
onblur='optionclass_onchange()'/></TD>
<TD NOWRAP><INPUT TYPE='BUTTON' VALUE='Edit Immutable Columns'
ONCLICK='efleft_onclick'/></TD>
</TR>
<TR>
<TD NOWRAP>Table Detail Class</TD><TD><INPUT TYPE='TEXT' NAME='tdclass'
onblur='tdclass_onchange()'/></TD>
</TR>
</TABLE>
</FORM>
</SPAN>
</BODY>
</HTML>