I have created a custom CMP that load resources with its tv value together in a grid .
longtitle , tvvalue1 , tvvalue2 = name , brand , color
and the overlay create page is created , but after saving , the processor cannot get the custom tv value (brand and color ) , so the tv value cannot be updated.. (but it created resource successfully )
processor
class ProductCreateProcessor extends modObjectCreateProcessor {
public $classKey = 'modResource';
public $languageTopics = array('product:default');
public $objectType = 'modResource';
public function cleanup() {
// $brand = $this->object->context->get('brand');
// $color = $this->object->context->get('color');
/* $this->object->setTVValue('Brand',18);
$this->object->setTVValue('Color',10); */
$brand = $scriptProperties['brand'];
$color = $scriptProperties['color'];
$this->object->setTVValue('Brand', $brand);
$this->object->setTVValue('Color', $color);
return $this->success('Optional message', $this->object);
}
}
return 'ProductCreateProcessor';
Product.window.CreateProduct = function(config) {
config = config || {};
Ext.applyIf(config,{
title: _('product.product_create')
,url: Product.config.connectorUrl
,baseParams: {
action: 'mgr/product/create'
}
,fields: [{
xtype: 'textfield'
,fieldLabel: 'Product Name'
,name: 'longtitle'
,anchor: '100%'
,allowBlank: false
}
,{
xtype: 'textfield'
,fieldLabel: 'Product Name (admin view)'
,name: 'pagetitle'
,anchor: '100%'
,allowBlank: false
}
,{
xtype: 'hidden'
,fieldLabel: _('product.name')
,name: 'template'
,anchor: '100%'
,value: 1
}
,{
xtype: 'hidden'
,fieldLabel: _('product.name')
,name: 'parent'
,anchor: '100%'
,value: 2
}
,{
xtype: 'product-combo-brand'
,fieldLabel: 'Brand'
,name: 'brand'
,anchor: '100%'
}
,{
xtype: 'product-combo-color'
,fieldLabel: 'Color'
,name: 'color'
,anchor: '100%'
}
] , success: function(o){
var fuckid = o.items.items[0].events.hide.listeners[0].scope.container.initialConfig.errorReader.jsonData.object.id;
location.href='?a=30&id='+fuckid;
},
});
Product.window.CreateProduct.superclass.constructor.call(this,config);
};
Ext.extend(Product.window.CreateProduct,MODx.Window);
Ext.reg('product-window-product-create',Product.window.CreateProduct);