Complex UI component, using dynamic rows in admin, for a product attribute, is not saving when removing all rowsMagento 2 Adminhtml spreading forms across multiple tabsHow to access the last added element in a dynamic rows componentMagento 2 - Dynamic rows based on related products modal grid on custom form with tabsHow to create a simple Dynamic rows in admin using Data Provider?Magento 2 - insertListing ui componentMagento 2.2.0 : TypeError: element.getRecordCount is not a function in dynamic rows in admin formAn Error while add a complex component modal as insertlisting for add dynamic row in my ui-component admin formCreating admin grid for custom eav model using ui componentError is showing saved data from database and display in dynamic row grid Magento 2Dynamic Rows can not delete in edit form in admin magento 2
Does this smartphone photo show Mars just below the Sun?
Is space radiation a risk for space film photography, and how is this prevented?
Why do proponents of guns oppose gun competency tests?
Should I take out a personal loan to pay off credit card debt?
Did the Sith know of Force ghosts?
How to continue a line in Latex in math mode?
is it possible to terraform a planet made of human excrement into habitable planet?
How to halve redstone signal strength?
Is Network I/O included in the timings for "RPC complete" seen in SQL Profiler?
The heat content of the products is more than that of the reactant in an ............. reaction
Is it true that control+alt+delete only became a thing because IBM would not build Bill Gates a computer with a task manager button?
Repeated! Factorials!
Will a paper be retracted if a flaw in released software code invalidates its central idea?
How many years before enough atoms of your body are replaced to survive the sudden disappearance of the original body’s atoms?
Onenote - Reducing Storage Footprint on PC
Was Richard I's imprisonment by Leopold of Austria justified?
Secure my password from unsafe servers
How to realistically deal with a shield user?
Does the length of a password for Wi-Fi affect speed?
How do I get the =LEFT function in excel, to also take the number zero as the first number?
Should I self-publish my novella on Amazon or try my luck getting publishers?
What is the German idiom or expression for when someone is being hypocritical against their own teachings?
Why do private jets such as Gulfstream fly higher than other civilian jets?
What is the bio-mechanical plausibility of a fox with venomous fangs?
Complex UI component, using dynamic rows in admin, for a product attribute, is not saving when removing all rows
Magento 2 Adminhtml spreading forms across multiple tabsHow to access the last added element in a dynamic rows componentMagento 2 - Dynamic rows based on related products modal grid on custom form with tabsHow to create a simple Dynamic rows in admin using Data Provider?Magento 2 - insertListing ui componentMagento 2.2.0 : TypeError: element.getRecordCount is not a function in dynamic rows in admin formAn Error while add a complex component modal as insertlisting for add dynamic row in my ui-component admin formCreating admin grid for custom eav model using ui componentError is showing saved data from database and display in dynamic row grid Magento 2Dynamic Rows can not delete in edit form in admin magento 2
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I created a complex product attribute entry in product admin, which uses dynamic rows.
Same idea as this core one:

UI works fine, but if you remove all rows, and save, the attribute does not update, and reloads back to the rows prior to removed. So, basically, you cannot clear out the rows/entries.
However, this example core one works 100%.
My entry is adjusted using UI Components modifiers, exactly like this core attribute is done.
https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AdvancedPricing.php#L433
(they used a derived UI component called Magento_Catalog/js/components/dynamic-rows-tier-price in place of Magento_Catalog/js/components/dynamic-rows, but they are essentially the same. Tested as well by making my component use the same, which did not solve the issue (just in case)
So, essentially, we have ability to build these complex input components, but they cannot be cleared.
magento2 uicomponent dynamic-rows
add a comment |
I created a complex product attribute entry in product admin, which uses dynamic rows.
Same idea as this core one:

UI works fine, but if you remove all rows, and save, the attribute does not update, and reloads back to the rows prior to removed. So, basically, you cannot clear out the rows/entries.
However, this example core one works 100%.
My entry is adjusted using UI Components modifiers, exactly like this core attribute is done.
https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AdvancedPricing.php#L433
(they used a derived UI component called Magento_Catalog/js/components/dynamic-rows-tier-price in place of Magento_Catalog/js/components/dynamic-rows, but they are essentially the same. Tested as well by making my component use the same, which did not solve the issue (just in case)
So, essentially, we have ability to build these complex input components, but they cannot be cleared.
magento2 uicomponent dynamic-rows
add a comment |
I created a complex product attribute entry in product admin, which uses dynamic rows.
Same idea as this core one:

UI works fine, but if you remove all rows, and save, the attribute does not update, and reloads back to the rows prior to removed. So, basically, you cannot clear out the rows/entries.
However, this example core one works 100%.
My entry is adjusted using UI Components modifiers, exactly like this core attribute is done.
https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AdvancedPricing.php#L433
(they used a derived UI component called Magento_Catalog/js/components/dynamic-rows-tier-price in place of Magento_Catalog/js/components/dynamic-rows, but they are essentially the same. Tested as well by making my component use the same, which did not solve the issue (just in case)
So, essentially, we have ability to build these complex input components, but they cannot be cleared.
magento2 uicomponent dynamic-rows
I created a complex product attribute entry in product admin, which uses dynamic rows.
Same idea as this core one:

UI works fine, but if you remove all rows, and save, the attribute does not update, and reloads back to the rows prior to removed. So, basically, you cannot clear out the rows/entries.
However, this example core one works 100%.
My entry is adjusted using UI Components modifiers, exactly like this core attribute is done.
https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AdvancedPricing.php#L433
(they used a derived UI component called Magento_Catalog/js/components/dynamic-rows-tier-price in place of Magento_Catalog/js/components/dynamic-rows, but they are essentially the same. Tested as well by making my component use the same, which did not solve the issue (just in case)
So, essentially, we have ability to build these complex input components, but they cannot be cleared.
magento2 uicomponent dynamic-rows
magento2 uicomponent dynamic-rows
edited Jul 29 at 5:49
ProxiBlue
asked Jul 28 at 5:17
ProxiBlueProxiBlue
8,9583 gold badges26 silver badges54 bronze badges
8,9583 gold badges26 silver badges54 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I am placing this answer, to allow someone having same issue get help.
Investigating how magento core solves this issue (thinking I am missing something in my UI Component setup), I found this line of code:
https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php#L202
$productData['tier_price'] = isset($productData['tier_price']) ? $productData['tier_price'] : [];
So, seems like this issue is solved (by core) as part of the product data initialisation
Essentially, the issue is that since the attribute contains no data, at saving, it is not in the POST data, so is not handled.
That line of code solves this.
The solution I did was to place a before interceptor to the initializeFromData method, and handle my own attribute the same.
Personally, I think this stinks. The UI component system should have a way to deal with this, and not need to place such code.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f283555%2fcomplex-ui-component-using-dynamic-rows-in-admin-for-a-product-attribute-is-n%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I am placing this answer, to allow someone having same issue get help.
Investigating how magento core solves this issue (thinking I am missing something in my UI Component setup), I found this line of code:
https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php#L202
$productData['tier_price'] = isset($productData['tier_price']) ? $productData['tier_price'] : [];
So, seems like this issue is solved (by core) as part of the product data initialisation
Essentially, the issue is that since the attribute contains no data, at saving, it is not in the POST data, so is not handled.
That line of code solves this.
The solution I did was to place a before interceptor to the initializeFromData method, and handle my own attribute the same.
Personally, I think this stinks. The UI component system should have a way to deal with this, and not need to place such code.
add a comment |
I am placing this answer, to allow someone having same issue get help.
Investigating how magento core solves this issue (thinking I am missing something in my UI Component setup), I found this line of code:
https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php#L202
$productData['tier_price'] = isset($productData['tier_price']) ? $productData['tier_price'] : [];
So, seems like this issue is solved (by core) as part of the product data initialisation
Essentially, the issue is that since the attribute contains no data, at saving, it is not in the POST data, so is not handled.
That line of code solves this.
The solution I did was to place a before interceptor to the initializeFromData method, and handle my own attribute the same.
Personally, I think this stinks. The UI component system should have a way to deal with this, and not need to place such code.
add a comment |
I am placing this answer, to allow someone having same issue get help.
Investigating how magento core solves this issue (thinking I am missing something in my UI Component setup), I found this line of code:
https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php#L202
$productData['tier_price'] = isset($productData['tier_price']) ? $productData['tier_price'] : [];
So, seems like this issue is solved (by core) as part of the product data initialisation
Essentially, the issue is that since the attribute contains no data, at saving, it is not in the POST data, so is not handled.
That line of code solves this.
The solution I did was to place a before interceptor to the initializeFromData method, and handle my own attribute the same.
Personally, I think this stinks. The UI component system should have a way to deal with this, and not need to place such code.
I am placing this answer, to allow someone having same issue get help.
Investigating how magento core solves this issue (thinking I am missing something in my UI Component setup), I found this line of code:
https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php#L202
$productData['tier_price'] = isset($productData['tier_price']) ? $productData['tier_price'] : [];
So, seems like this issue is solved (by core) as part of the product data initialisation
Essentially, the issue is that since the attribute contains no data, at saving, it is not in the POST data, so is not handled.
That line of code solves this.
The solution I did was to place a before interceptor to the initializeFromData method, and handle my own attribute the same.
Personally, I think this stinks. The UI component system should have a way to deal with this, and not need to place such code.
edited Jul 29 at 6:45
answered Jul 28 at 5:21
ProxiBlueProxiBlue
8,9583 gold badges26 silver badges54 bronze badges
8,9583 gold badges26 silver badges54 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f283555%2fcomplex-ui-component-using-dynamic-rows-in-admin-for-a-product-attribute-is-n%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown