[Dialog] Unable to close a dialog from a button.

[Dialog] Unable to close a dialog from a button.


Hi everybody,
I have a dialog who is built like this :
--- 8<
-----------------------------------------------------------------------------------------------------
var width = 500;
var height = 500;
if (navigator.appName.indexOf("Microsoft")!=-1) {
    width = document.body.offsetWidth*0.6;
    height = document.body.offsetHeight*0.75;
} else {
    width = window.innerWidth*0.6;
    height = window.innerHeight*0.75;
}
$.get('<cor:url value="/frames/studentfolder/resume.html?folder=$
{folder}" />',
    function(data) {
        $("<div class=\"dialogcontainer\"></div>").append(data).dialog({
            modal: true,
            width: width,
            height: height,
            bgiframe: true,
            buttons : {
                '<fmt:message key="label.Terminate" />' : function(){
                 $(this).dialog("close");
                },
                '<fmt:message key="label.Modify" />' : function(){
                    window.location=window.location;
                },
                '<fmt:message key="label.Print" />' : function(){
                    $.wait('<fmt:message key="label.Printing" />');
                }
            },
            title: 'Done'
        });
});
--- 8<
-----------------------------------------------------------------------------------------------------
With the first button "<fmt:message key="label.Terminate" />" I want
to close the dialog but the line "$(this).dialog('close');" doesn't
seems to work.
I am under Firefox with Firebug and no errors occur..
How can I close a dialog from itself ?
Thanks