Hi all

I am trying to use saveOnclick feature to validate my dialogs.
So I added following node to my dialog (which is used in Page Properties
paragraph)


        saveOnclick             MyClass.validate()



Then I created under

        WEB-INF\classes\mgnl-resources\js-classes\mycompany\dialog

a file called MyClass.js which looks like this:


classDef("mycompany.dialog.MyClass", {
    validate: function (){
        var value = document.mgnlFormMain.title.value;

        if(value.length > 10){
            alert("Title too long");
            return false;
        } else {
                  mgnlDialogFormSubmit();
        }

    }
});




However I cannot get this to work...
When I click Save button on my dialog nothing happens....

I used Firebug in Firefox and I am getting an error
"MyClass is not defined 
(onclick click clientX=0,clientY=0)"

And the file referenced is page-propetries.html




Any ideas...Seems like a Prototype guru (which I am not) would be able to
figure this one out fairly quickly...


Thanks
Amir




----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/developer.html
----------------------------------------------------------------

Reply via email to