setOnClickHandler

My code looks like this:

aToolBar.setOnClickHandler(doButtonClick);

function doButtonClick(itemId,itemValue)

{ alert(itemId); }



This does not seem to work. Instead I get this Javascript error:

Error: that.persAction is not a function

Source File: otshop.no/js/dhtmlxToolbar/c … rotobar.js

Line: 10

Please be sure that next command
    aToolBar.setOnClickHandler(doButtonClick);

was called before xml with configuration loaded ( or before buttons added by script )

>> Error: that.persAction is not a function

Such error can occurs if you are using
    menu.setItemAction
with non function parameter.