Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Show/hide custom button in http://localhost:4502/aem/inbox in vanilla AEM 6.4instance

Avatar

Level 8

Hi,

This is a requirement I need to build on top of Re: Customize http://localhost:4502/aem/inbox in vanilla AEM 6.4instance .

I have a custom button say "My Complete" on clicking of which my custom dialog shows up. I have a situation wherein,  we need to add a check for our custom button,

that based on certain property, my custom button can show or not. That property needs to be on the task.

Any thoughts/pointers/reference code on this will be helpful.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

You can write javascript to add listener for onClick events on selection of task and read task row DOM and check if showButton=true there in DOM then do nothing otherwise hide button



Arun Patidar

View solution in original post

9 Replies

Avatar

Community Advisor

Hi,

The show hide is depends on granite:rel property of button.

And your task should have that value inside meta tag e.g.

Screen Shot 2018-06-07 at 4.59.07 PM.png

Thanks

Arun



Arun Patidar

Avatar

Level 8

Hi Arun,

Not sure if I got you.

On my custom button have the below granite:rel property that you mentioned

1503801_pastedImage_0.png

and I am setting for example say some property 'showButton = {Boolean}true' on the task '/content/projects/we-retail/jcr:content/tasks/2018-06-05/task_from_workflowlaunchedbyproject'

Was planning to have something like if showButton = true, show the custom button, else hide it.

Not sure how do I achieve this.

Any thoughts/pointers will be helpful.

Avatar

Level 10

Can you post your package on Google Drive so community can download what you have down and try and solve this for you. Hard to find the solution when there is not access to the details you have done.

Avatar

Correct answer by
Community Advisor

Hi,

You can write javascript to add listener for onClick events on selection of task and read task row DOM and check if showButton=true there in DOM then do nothing otherwise hide button



Arun Patidar

Avatar

Level 8

Hi Scott,

working inbox one.zip - Google Drive

Here there is overlaying done on apps\cq\inbox, so that it displays "My Complete" button as seen below.

All it does right now is to open a custom dialog, on clicking "My complete". The functionality is not built completely yet for the custom dialog.

And I want to hide/show this custom button based on some property in the selected task say 'showButton = {Boolean}true'.

1503984_pastedImage_1.png

Avatar

Level 8

Hi Arun,

Thank you for your reply.

If you can provide some code around this, would be really helpful.

Avatar

Community Advisor

I've sent you the code but you need to adapt that according to your requirement.

Thanks

Arun



Arun Patidar

Avatar

Level 8

Hi Arun,

Thanks a ton for your help.

Marking this as correct. Posting another question in forum to as to how to read custom property added on the task [/content/projects/we-retail/jcr:content/tasks/2018-06-08/task_from_workflowlaunchedbyproj ect2] and how to retrieve its value and add business logic to it.

Once again, thanks a lot for all your help.