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
BedrockMission!

Learn More

View all

Sign in to view all badges

Show/hide related implementation in dialog in AEM 6.3

Avatar

Avatar
Validate 50
Level 6
cquser1
Level 6

Likes

75 likes

Total Posts

313 posts

Correct Reply

15 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Give Back 50
View profile

Avatar
Validate 50
Level 6
cquser1
Level 6

Likes

75 likes

Total Posts

313 posts

Correct Reply

15 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Give Back 50
View profile
cquser1
Level 6

23-07-2017

Hi zeeshan/All,

Show hide dialog fields based on selection in AEM 6.3 Based on the inputs provided here, have been trying on this for quite some time.

My component dialog is like

/apps/sample/components/content/samplleone/cq:dialog/content/items/listing/items/column/items.

Under this directly[direct descendanats] I have the below 

I have selection node of type granite/ui/components/foundation/form/select. which has values value1, value2 ....to value6.

Have two more nodes 'x' and 'y' of type granite/ui/components/foundation/container.

Basically on selection of value1 only, I have to show node 'x'. On selection of other values in dropdown, have to show node 'y'.

Tried various things, but no luck.

Custom js Code I tried so far as below :

(function(document, $) { 

$(document).on("foundation-contentloaded", function(e) {

        showHide();

    });

    function showHide(){

         var value = $("[name='./pagetitle']").val() ;

    }

})(document,Granite.$);

Once, I do the above none of the container fields show up and so many errors  come up in browser console[which seems to be pointing to some OOTB js files].

Any thoughts/pointers/reference code will be really helpful.

View Entire Topic

Avatar

Avatar
Boost 5
Level 4
zeeshank1500736
Level 4

Likes

28 likes

Total Posts

103 posts

Correct Reply

33 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile

Avatar
Boost 5
Level 4
zeeshank1500736
Level 4

Likes

28 likes

Total Posts

103 posts

Correct Reply

33 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile
zeeshank1500736
Level 4

23-07-2017

Hi,

It seems that above code will through Jquery error due to not found of $("[name='./pagetitle']") value of undefined name.

did you follow this article it might helpful Toggle fields based on selection in Granite UI dialogs | Adobe AEM Club

Thanks