ip2.declare("Portfolio.userRole", {

	xtype: "container",

	require: [
		"Ext.ux.navigation.controller.UserRole",
		"Ext.ux.navigation.view.UserRolePanel"
	],

	border: false,

	autoScroll: true,
	
	title: "",

	onInitialize: function(widget, owner) {

		widget.userRolePanel = Ext.widget("userrolepanel", {
			record: owner.dataParent.getRecord(),
			entity: widget.entity
		});

		widget.relayEvents(widget.userRolePanel, ["savecomplete"]);

		widget.add(this.userRolePanel);
	},

	doSave: function(f_callback) {

		f_callback = f_callback || Ext.emptyFn;

		var i_widget = this;
		var i_userRolePanel = i_widget.userRolePanel;
		i_userRolePanel.record = i_widget.ownerCt.dataParent.getRecord();
		i_userRolePanel.getController().doSave();

		f_callback();

	},

	doDelete: function(f_callback) {

		f_callback = f_callback || Ext.emptyFn;

		var i_widget = this;
		var i_userRolePanel = i_widget.userRolePanel;
		i_userRolePanel.getController().doDelete();

		f_callback();
	},

	isDirty: function() {
		return this.ownerCt.isDirty();
	}
});
