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

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>
  • this is not working – Ashar Riaz Nov 10 '16 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.