Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Why is a tag field being hidden on a dialog?

Avatar

Level 3

The company I am working with has been using commerce assets to create some content. In the scaffolding, they have a tag field that is used to get titles associated with an asset. When the dialog is rendered, this field is having the style="display: none;" attribute added to the field.

 

My question is:

What would be setting this when the dialog is being rendered?

 

I need this field to be visible when the authors are updating information.

 

There isn't any show/hide logic in the dialog so that can't be it.

0 Replies

Avatar

Level 9

@RobertHarper Can you please elobrate or attach any screenshot that would be really helpfull.

 

i am thinking that should be a custom requirement by your company. 

Avatar

Level 3

I don't know what a screenshot would do. It would only show that the field is not visible. It is a tag selector marked as allowing multiple selections. There is nothing in the dialog definition about showing or hiding fields based on a selection. When the dialog is rendered, the field's style attribute is marked style="display: none;".

I looked at the initial document that was sent from the server and it is not set. There is some JavaScript that is doing this but I can't find it. It isn't custom code. It is something OOTB that is doing it.

What would be setting this and why?

Avatar

Level 3

No. Because of version differences and other factors I haven't been able to resolve, I cannot open the dialog in my local instance and I am not cleared to change settings on the cloud services. I'm not sure minification would change anything other that provide the full name to variables. The actual values for settings do not get changed and I've used the search feature to find all occurrences of "display: none" and just "none". I placed breakpoints where the setting is being changed but they aren't hit when the page is loaded.

Avatar

Level 2

In the Component Dialog, do you have any clientlib added. Can you see if categories property is added in cq:dialog field. If yes, then kindly find the clientlib and see if the Hide rule is added there. 

Avatar

Level 3

Sorry all. I forgot to notify that I figured it out. Our site shares the host with a couple others and they have added a client lib that hides the cq:tags fields for some business reason but did not code it so that it restricted this behavior to their site. I did not realize this until I set breakpoints in the jQuery api and checked the call stack in the developer tools.

 

Thanks for your input though.

 

Lesson to all. Write javascript that isolates itself to each instance of a component and not general selectors and make sure that the code does not have side effects on other components.