Type.registerNamespace("Zap.BI.Portal.Controls");

Zap.BI.Portal.Controls.RemotePost = function(element) {
    Zap.BI.Portal.Controls.RemotePost.initializeBase(this, [element]);
};

Zap.BI.Portal.Controls.RemotePost.prototype =
{
    initialize: function RemotePost_initialize() {
        Zap.BI.Portal.Controls.RemotePost.callBaseMethod(this, "initialize");

        if (this.get_AutoPost()) {
            setTimeout(this.post.bind(this), 0);
        }
    },

    dispose: function RemotePost_dispose() {
        Zap.BI.Portal.Controls.RemotePost.callBaseMethod(this, "dispose");
    },

    get_AutoPost: function() { return this._autoPost; },
    set_AutoPost: function(val) { this._autoPost = val; },

    post: function RemotePost_post() {
        this.get_element().trigger('submit');
    }
};


if (typeof (Sys) !== 'undefined') Zap.BI.Portal.Controls.RemotePost.registerClass('Zap.BI.Portal.Controls.RemotePost', Sys.UI.Control, Sys.IDisposable);
