We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40715
    • 13 Posts
    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);
    

      • 4172
      • 5,888 Posts
      try:

      $brand = $this->getProperty('brand');
      $color =  $this->getProperty('color'); 
      
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 40715
        • 13 Posts
        thanks, but seems not work.
          • 10378
          • 375 Posts
          Hi yen_li_yen,

          sorry I have no solution for your problem - but a question:

          I'm currently working on a similar solution: load resources from an Articles container and list them in an CMP page in MODx backend including some TV values.

          Would you be so kind and let me see how you managed to write the getlist.class.php processor as well as the corresponding mgr widget file (products.grid.js or so)?

          I'm very new to MODx development so it's hard for me to figure out how to do this.

          Thanks,
          Martin
            Freelancer @bitego http://www.bitego.com
            ---
            GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
            More infos here: http://www.bitego.com/extras/goodnews/