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

	xtype: "LINKFIELD",

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

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

				var i_field = this;

				if (!i_field.getValue()) {
					Ext.MessageBox.alert('Message', 'Url required');
				} else {
					i_field.fireEvent("onAddWebContainer", {
						url: i_field.getValue(),
						title: i_field.getValue()
					});
				}
			}
		}
	},

	validationEvent:false,
	validateOnBlur:false,

	initComponent: function () {

		var i_self = this;
		i_self.callParent();

		i_self.enableBubble("onAddWebContainer");
	}
});
