Ext.define("IceCap.ux.form.field.LINKFIELD", {

	extend: "Ext.form.field.Text",

	alias: [
		"widget.LINKFIELD"
	],

	triggers: {
		switch: {
			cls: "icecap-form-link-trigger",
			overCls: "no-overcls",
			clickCls: "no-clickcls",
			weight: 1,
			scope: "this",
			handler: function(i_trigger) {

				var i_field = this;

				if (!i_field.getValue()) {
					Ext.MessageBox.alert("Message", "Url required");
				}
				else {
					window.open(i_field.getValue(), i_field.getValue(), "");
				}
			}
		}
	},

	validationEvent: false,
	validateOnBlur: false,

	initComponent: function () {

		var i_self = this;
		i_self.callParent();
	}
});
