Board Logo

How use the -hs- tag for Event Handlers
rvazquezto - 9/18/2003 at 10:55 PM

<!-- hi i have one problem to try use the -hs- tag for Event Handler, when try to implement, the program showme the message: --Se produjo un error en tiempo de ejecucion . ?Desea depurarlo? Linea: 9 Error se esperaba un objeto ---- then the system open a new browser window try to show the page 0 (cero) whats wrong?. the code is : -->
<html>
<head>
<style>
a, A:link, a:visited, a:active
{color: #0000aa; text-decoration: none; font-family: Tahoma, Verdana; font-size: 11px}
A:hover
{color: #ff0000; text-decoration: none; font-family: Tahoma, Verdana; font-size: 11px}
p, tr, td, ul, li
{color: #000000; font-family: Tahoma, Verdana; font-size: 11px}
.header1, h1
{color: #ffffff; background: #4682B4; font-weight: bold; font-family: Tahoma, Verdana; font-size: 13px; margin: 0px; padding: 2px;}
.header2, h2
{color: #000000; background: #DBEAF5; font-weight: bold; font-family: Tahoma, Verdana; font-size: 12px;}
.f
{color: #000000; font-family: Tahoma, Verdana; font-size: 11px; padding-left: 15px; padding-right: 15px;}
</style>
<script language="JavaScript" src="tree.js"></script>
<script language="JavaScript" src="tree_items.js"></script>
<script>
TREE_ITEMS = [
['Catalogo de Cuentas', 0, {'tt' : 'Window object', 'sb':'Window object'},
['Cuenta de Mayor', 0, {'tt' : 'Properties of the window object', 'sb' : 'Properties of the window object'},
['Sub Cuenta', 0, {'tt' : 'Document object', 'sb' : 'Document object'},
['Sub Sub Cuenta',0,{'hs' : 'colocaCuenta(this)'}], <!-- using the -hs tag -->
['Sub Sub Cuenta',0,{'hs' : 'colocaCuenta(this)'}] <!-- using the -hs tag -->
]
]
]
];
function colocaCuenta(o_item){
alert("Execution OK :" + o_item.a_config[0]);
}
</script>
<script language="JavaScript" src="tree_tpl.js"></script>
<link rel="stylesheet" href="tree.css">
</head>
<body bottommargin="15" topmargin="15" leftmargin="15" rightmargin="15" marginheight="15" marginwidth="15" bgcolor="white">
<table cellpadding="0" cellspacing="20" border="0" width="100%">
<tr>
<td valign="top">
<div style='width:300'>
<script language="JavaScript">
new tree (TREE2_ITEMS, TREE_TPL);
</script>
</div>
</td>
<td valign="top">
<div style='width:300'>
<script language="JavaScript">
new tree (TREE_ITEMS, TREE2_TPL);
</script>
</div>
</td>
</tr>
</table>
</body>
</html>


rock - 9/19/2003 at 07:00 AM

You should declare event handler without any parameters. E.g.:
['Sub Sub Cuenta',0,{'hs' : 'colocaCuenta'}],
...
function colocaCuenta(o_item){
alert("Execution OK :" + o_item.a_config[0]);
}


rvazquezto - 9/19/2003 at 07:13 PM

Quote:
Originally posted by rock
You should declare event handler without any parameters. E.g.:
['Sub Sub Cuenta',0,{'hs' : 'colocaCuenta'}],
...
function colocaCuenta(o_item){
alert("Execution OK :" + o_item.a_config[0]);
}



the error is not present BUT on a new browser windows or on another browser window show the page 0 (cero) or null, what can i do to prevent this?


rock - 9/20/2003 at 08:45 AM

Please find examples of localy defined event handler in demo4 of your Tigra Tree Menu PRO distribution package.


rvazquezto - 9/21/2003 at 02:22 AM

[quote][i]Originally posted by rock[/i]
Please find examples of localy defined event handler in demo4 of your Tigra Tree Menu PRO distribution package. [/quote]

Sorry but for handle the select item event the documentation, only say the -hs- tag, not mention -function onItemSelectHandler (o_item) - .. I just need the execution one javascript function when the user click on a final node of the tree, do you have some sample for that?, do you send me the sample please?


rock - 9/21/2003 at 03:58 AM

Please contact us at http://www.softcomplex.com/support/


rvazquezto - 9/21/2003 at 04:28 AM

Quote:
Originally posted by rock
Please contact us at http://www.softcomplex.com/support/


i found why dont work its the - return true; - on the function colocaCuenta, the function recite:

function colocaCuenta(o_item){
alert("Execution OK :" + o_item.a_config[0]);
return true;
}


Realy thanks for hear me..


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/