since ‎17-11-2020
Online
Shaheena_Sheikh
Level 1
Re: Check if new item is added to the multifield
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
my func is getting triggered when i am opening the dialog. Not when i click on the Add button

Views

20

Likes

0

Replies

0
Check if new item is added to the multifield
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
I want to call a JS function when a new item is added to the multifield. I have tried: $(".cq-dialog").find("coral3-Button coral3-Button--secondary").on("click", funcName);doesn't call my function.

Views

33

Likes

0

Replies

3
Re: Granite:id to granite:class
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
i was referring to https://adapttoaem.blogspot.com/2021/02/setting-dynamic-dropdownselect-value-in.html in here, the only difference is that in my case the colorfield is inside a multifield

Views

28

Likes

0

Replies

0
Re: Granite:id to granite:class
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
i pasted the complete function for better understanding. And the first code is not having any multifield

Views

47

Likes

0

Replies

0
Re: Granite:id to granite:class
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
my font-field is within multifield

Views

55

Likes

0

Replies

0
Re: Granite:id to granite:class
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
Parathesis are all in place in my actual code, pasted it wrong here. Console error: Cannot read property 'clear' of undefined for the line where optionItems are getting cleared.

Views

47

Likes

0

Replies

0
Granite:id to granite:class
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
If I replace: const setOptions = function () {let fontField = $(".cq-dialog").find("#fontField ")[0];let optionItems = fontField.items;optionItems.clear();for (var i = 0; i < 1; i++) {let obj = new Object();let cnt = new Object();obj["value"] = "#ffffff";cnt["textContent"] = "white";obj["content"] = cnt;optionItems.add(obj);}};with:const setOptions = function () {$(".coral3-Multifield-item").each(function( index ) {let fontField = $(this).find(".fontField ");var arah=["#ffffff","#000000",""];var...

Views

112

Likes

0

Replies

9
Re: Disabling a field in dialog
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
Yes, I am using JS to make my field readOnly. Thanks for the info.

Views

57

Likes

0

Replies

0
Re: Disabling a field in dialog
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
thanks! fontField.readOnly=true; works

Views

77

Likes

0

Replies

0
Re: Disabling a field in dialog
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
I updated 'let' to 'var' and it's still the same 😞

Views

48

Likes

0

Replies

0
Disabling a field in dialog
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
I have the below code:let fontField = $(".cq-dialog").find("#contentColor")[0];fontField.value="#ffffff";fontField.disabled=true; the colorfield shows #ffffff and as disabled. But after closing the dialog, I don't see the color of the font as white (#ffffff). If I comment the line of code having disabled, the color starts reflecting. If i comment the third line of code, the value for the colorfield gets stored in the node but if I don't comment the third line then the value doesn't get stored at...

Views

108

Likes

0

Replies

6
Re: ID for a field in multified
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
so, if I have 4 multifield items how can i get the data for each textfield in each item?

Views

110

Likes

0

Replies

0
ID for a field in multified
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
I have a textfield within a multified. I need to fetch the ID for the textfield each item a new multified item is added. Since the textfield is within the multified I am not sure how can i set the granite:id to it. Any suggestion?

Views

155

Likes

0

Replies

5
loading clientlib for dialog
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
I have a clientlib with 3-4 js files in it in a component. I wanted 1 of those JS files to load for my dialog. I cant use extraClientlibs because that way all the JS will load for my dialog, whereas I specifically want only 1 particular file to load for my dialog. Is there a way to do this?

Views

135

Likes

0

Replies

4
Refresh page after editing component
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
I have a component with various fields in it along with image field. I want to refresh the page only when the image field is update. Right now I'm using edit:config to refresh page "afteredit". How can I refresh the page only when the image field is edited?

Views

165

Likes

0

Replies

5
Re: Add field description property dynamically to the dia...
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
thanks for the solution. I too found another way of dealing with it. I am removing/adding the ID everytime theres a validation to keep only a single alert.

Views

118

Likes

0

Replies

0
Re: Add field description property dynamically to the dia...
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
updated the code snippet and the problem statement.

Views

131

Likes

0

Replies

0
Re: Add field description property dynamically to the dia...
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
i am trying to use coral-alert instead of window.alert. But the problem is, the alert is getting added to the entire page instead of the dialog and is not even clearly visible

Views

142

Likes

0

Replies

0
Re: Add field description property dynamically to the dia...
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
yes, coral alert would help. But i am not sure how i can add this to my JS

Views

110

Likes

0

Replies

0
Re: Add field description property dynamically to the dia...
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
I am not necessarily looking for field descriotion, but i only want to prompt the user with a msg that they using wrong color, and dont even want to prevent them from using the wrong color.

Views

92

Likes

0

Replies

0
Re: Add field description property dynamically to the dia...
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
this will hide the entire color field, whereas i only want to hide field description of the colorfield

Views

96

Likes

0

Replies

0
Re: Add field description property dynamically to the dia...
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
I dont want to add the return msg, because this will not let the user save the dialog if there's a wrong color chosen and it will force them to correct the colour. But i dont want to force the user to correct the value. I only want to give them a msg through field description that they have chosen a wrong color and then let them save the wrong value if they want.

Views

165

Likes

0

Replies

0
Add field description property dynamically to the dialog through JS
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
I have a JS file for my validation of colorfield. In the process of validation, if any inaccessible color is added to the colorfield, then i want to add the field description with a msg for the user. i have a granite:data node as a child node to the colorfield. The granide:data node is having selector : contain. I am also able to successfully fetch and validate the color values that are getting selected in the swatch. I am also able to show the coral alert. But the problem is that it keeps comin...

Views

250

Likes

0

Replies

15
ACS report
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
I have a component with 3 colorfields. The swatch of each colorfield only shows 5 accessible colors.I need to get a report of all the pages that are using this component and if they using any inaccessible color in any of the colorfields.I have ACS Commons in my instance. I was thinking if I could get a query to run a report and get the above details?Or do you have any other suggestions?

Views

82

Likes

0

Replies

1
Re: Multifield issue - validation
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
added code

Views

108

Likes

0

Replies

0
Re: Multifield issue - validation
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
i think i didnot mention my problem correctly. let me rephrase my question.

Views

132

Likes

0

Replies

0
Multifield issue - validation
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
I have a multified (say, list) and within that there's a textfield (say, title) which is set as required. Now if a user adds too many multifield section(say, product1, product2, product3) and then collapses all the sections. he filled in title field in product1 and product3 and missed to fill in 1 title in produc2, then if he tries to close the dialog box, he will not be able to close the dialog box, because title is a mandatory field and it is not filled. Also at the same time since all the mul...

Views

178

Likes

0

Replies

6
Re: checkbox in dialog
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
I just realised the line should be var check = $(".cq-dialog").find("#checkbox")[0].checked; instead ofvar check = $(".cq-dialog").find("#checkbox")[0].value;

Views

78

Likes

0

Replies

0
checkbox in dialog
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
I have a checkbox in my dialog box. I have added the property "value" and value as "true" (string). When i open my dialog box, and if check/uncheck the checkbox, i always see the console log "check true". How can i get the correct detail if the checkbox is checked/unchecked?I am using granite:data node and the below js code:$(window).adaptTo("foundation-registry").register("foundation.validation.validator", {selector: "[data-checkbox]",validate: function(checkbox) {var check= checkbox.value;cons...

Views

104

Likes

0

Replies

3
Re: fetch window URL and verify using data-sly-test
Avatar

Shaheena_Sheikh

Shaheena_Sheikh
- Adobe Experience Manager
My other concern is, when my page goes live on a domain, will this wcm mode code still work? In case of going live also, i would need the publish part of code to get rendered. Can you please confirm this?

Views

115

Likes

0

Replies

0