1

I am working on an extension where i want to load products grid serializer inside form. I followed magento_catalog and adding below code in my ui_component form.

<fieldset name="assign_products">
 <argument name="data" xsi:type="array">
 <item name="config" xsi:type="array">
 <item name="label" xsi:type="string" translate="true">Products in Category</item>
 <item name="collapsible" xsi:type="boolean">true</item>
 <item name="sortOrder" xsi:type="number">40</item>
 </item>
 </argument>
 <container name="assign_products_container" >
 <argument name="data" xsi:type="array">
 <item name="config" xsi:type="array">
 <item name="sortOrder" xsi:type="number">160</item>
 </item>
 </argument>
 <htmlContent name="html_content">
 <argument name="block" xsi:type="object">Magento\Catalog\Block\Adminhtml\Category\AssignProducts</argument>
 </htmlContent>
 </container>
</fieldset>

but getting this error

Fatal error: Uncaught Error: Call to a member function getProductsReadonly() on null in C:\xampp\htdocs\m22\vendor\magento\module-catalog\Block\Adminhtml\Category\Tab\Product.php:137

asked Nov 9, 2016 at 13:00

1 Answer 1

0

Try this code :

 <block class="<vendor_name>\<module_name>\Block\Adminhtml\Grid\AssignedProduct" name="promo_catalog_edit_tab_affected" >
 <arguments>
 <argument name="config" xsi:type="array">
 <item name="label" xsi:type="string" translate="true">Products in Category</item>
 <item name="collapsible" xsi:type="boolean">true</item>
 <item name="opened" xsi:type="boolean">false</item>
 <item name="sortOrder" xsi:type="number">40</item>
 <item name="canShow" xsi:type="boolean">true</item>
 <item name="componentType" xsi:type="string">fieldset</item>
 </argument>
 </arguments>
 </block>
answered Nov 9, 2016 at 13:18
1
  • this is not working Commented Nov 10, 2016 at 9:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.