6

I have used the below code in view :

<exportButton name="export_button">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="selectProvider" xsi:type="string">pos_outlet_listing.pos_outlet_listing.pos_outlet_columns.ids</item>
                </item>
            </argument>
</exportButton>

Got Error:

Notice: Undefined index: attributes in /home/yaboow/public_html/demo/vendor/magento/framework/View/Element/UiComponentFactory.php on line 176

version 2.3

Is there anything i have missed!!?

8
  • Have you add column of primary key in your listing grid? Jan 1, 2019 at 4:50
  • '<argument name="requestFieldName" xsi:type="string">id</argument> <argument name="primaryFieldName" xsi:type="string">id</argument>' added like this under data source tag Jan 1, 2019 at 5:23
  • Can you please your listing file code.So i can help you Jan 1, 2019 at 5:27
  • github.com/azlamptb/Magento You can see the file here Jan 1, 2019 at 5:36
  • <!-- <selectionsColumn name="ids"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="resizeEnabled" xsi:type="boolean">false</item> <item name="resizeDefaultWidth" xsi:type="string">55</item> <item name="indexField" xsi:type="string">id</item> </item> </argument> </selectionsColumn> --> just uncomment this your code will work as expected Jan 1, 2019 at 5:50

2 Answers 2

6
       <!-- <selectionsColumn name="ids"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="resizeEnabled" xsi:type="boolean">false</item> <item name="resizeDefaultWidth" xsi:type="string">55</item> <item name="indexField" xsi:type="string">id</item> </item> </argument> </selectionsColumn> -->

You just need to remove comment form above code. Because UiComponentFactory.php take Data of array from it and pass this data to it's parent

     public function __construct(
    ObjectManagerInterface $objectManager,
    ManagerInterface $componentManager,
    InterpreterInterface $argumentInterpreter,
    ContextFactory $contextFactory,
    array $data = [],
    array $componentChildFactories = [],
    DataInterface $definitionData = null,
    DataInterfaceFactory $configFactory = null
) {
    $this->objectManager = $objectManager;
    $this->componentManager = $componentManager;
    $this->argumentInterpreter = $argumentInterpreter;
    $this->contextFactory = $contextFactory;
    $this->componentChildFactories = $componentChildFactories;
    $this->configFactory = $configFactory ?: $this->objectManager->get(DataInterfaceFactory::class);

parent::__construct($data);

            $this->definitionData = $definitionData ?:
        $this->objectManager->get(DataInterface::class);
}

And it's parent class

Magento\Framework\DataObject

data set in SetData function

2
  • 1
    hi @Rutvee, I am also facing same issue, but i do not see any code like that in my listing.xml, the export is working well only i need to change the csv file to store in media directory Jul 29, 2019 at 11:11
  • @jafarpinjar How can you change the CSV file to store in media directory? i'm facing the same issue Aug 4, 2021 at 12:05
5

Check if yo have selection columns, if not add this

    <selectionsColumn name="ids">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="resizeEnabled" xsi:type="boolean">false</item>
                <item name="resizeDefaultWidth" xsi:type="string">55</item>
                <item name="indexField" xsi:type="string">id</item>
            </item>
       </argument>
    </selectionsColumn>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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