by Gordon on Thu Feb 04, 2010 9:01 am
Hi
You could try building the menu in html and rendering it each time the user selects an option ie re draw the whole thing.
This is a an extremely rough example but does work. Servoy renders this sufficiently quickly that you can do some pretty cool stuff with decoration and the like too.
//variable to stick the result into that is displayed on the page as an un editable html area
var htmlField = '';
//This is the function you want the clicked menu to call
function htmlFieldAction()
{
application.output('Link number: '+arguments[0]+' clicked...');
}
//this renders the html in the first place. Note I have had to stick an IF in here to change the font size depending on whether the user is using web or
//smart client. Its probably a css issue that I have not tracked down yet and will be blindingly obvious to others
function populateHtml()
{
var navHtml = '';
navHtml = '<html><head>';
navHtml += '<style type="text/css">';
navHtml += 'a {color:#999999; text-decoration: none; font-size: 9px; font-weight:450;}';
navHtml += 'a:hover {color:#717171}';
navHtml += 'a.on {color:#363636; font-weight:bold }';
//navHtml += 'a:link{color:#000000}';
navHtml += '</style></head><body>';
// Simple loop, make 5 menu items
for(var i=0; i<5; i++)
{
navHtml += '<a href="javascript:htmlFieldAction('+i+')">This is link '+i+'</a><BR>';
}
navHtml += '</body></html>';
htmlField = navHtml;
}
Cheers
Gordon