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

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

	alias: [
		"widget.LibraryFileDependency"
	],

	listeners: {
		blur: {
			fn: function(i_field) {

				var i_self = this;
				var i_ownerCt = i_self.ownerCt;

				var i_owner = Ext.getCmp(i_ownerCt.id);

				var a_inputs = i_owner.query("input");

				Ext.Array.each(a_inputs, function(i_input) {

					if (i_input.getStore) {

						var i_store = i_input.getStore();
						var i_proxy = i_store.getProxy();

						var o_params = i_proxy.getExtraParams();

						Ext.apply(o_params, {
							lib: i_field.getValue()
						});

						i_store.load();
					}
				});
			}
		}
	}
});
