First
Init the controller before you call any other function.
itemClick: function itemClick(distributor, product) {
var ctrlr = this.getController('Internal.controller.Popup');
ctrl.init();
var win = ctrlr.openWin(distributor, product);
}
Second
Check if you have the arguments and set them. For that you can use the setValues methods of the baseform
openWin: function openWin(distributor, product) {
var win = Ext.create('Ext.window.Window', {
...
});
var form = win.down('form').getForm();
setObj = {};
if (distributor) {
setObj['DistributorFieldName'] = distributor;
}
if (product) {
setObj['ProductFieldName'] = product;
}
// set the values
form.setValue(setObj );
return win;
}