We recently did inplace upgrade from AEM 6.3 to AEM 6.5.
The default value set in a dropdown using select component worked fine for touch UI with following setup but not working in 6.5.
selected="{Boolean}true"
In 6.5,the default value setup is not working there by always displaying the top one in the deopdown. Please advise ASAP.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi,
It should work in 6.5, It checked against Coral3/Granite resourceType and working fine
granite/ui/components/coral/foundation/form/select
the selected property is not gonna work if component is already authored.
Can you try using Coral3 Select[1] resourcetype and let me know if this is still an issue?
Hi,
It should work in 6.5, It checked against Coral3/Granite resourceType and working fine
granite/ui/components/coral/foundation/form/select
the selected property is not gonna work if component is already authored.
Hi i have a similar issue. The above property works fine but i had to open the dialog and close it to see the changes getting applied. Any solution for that.
My requirements are to change the container component dropdown value to be always responsive by default. The above property does that job but does not allow me to resize the contained components. I had to open the container component dialog again and click on ok to apply the changes.
Views
Replies
Total Likes
Hi @arunpatidar
I'm facing same issue with dropdown here.
I've set the selected value, still after the next deployment its not taking that default value. We need to again select/author it manually.
"the selected property is not gonna work if component is already authored." == this one I considered still facing same issue for other country pages.
Do we have any quick solution on it?
Thanks,
Nikita M
Hi @Nikita_Mazire
You can write a small javascript to initialise the dropdown with default value if none is selected.
E.g.
(function (document, $) {
"use strict";
$(document).on("foundation-contentloaded", function() {
$(".dropdown-field-selector-class").each(function() {
let $dropdown = $(this);
let selected = $dropdown.find("coral-select-item[selected]");
if (selected.length === 0) {
$dropdown.find('coral-select-item[data-selected]').first().attr('selected', true);
}
});
});
})(document, Granite.$);
Views
Likes
Replies
Views
Likes
Replies