Show/hide custom button in http://localhost:4502/aem/inbox in vanilla AEM 6.4instance | Community
Skip to main content
cquser1
New Participant
June 7, 2018
Solved

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

  • June 7, 2018
  • 9 replies
  • 2379 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

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

9 replies

cquser1
cquser1Author
New Participant
June 10, 2018

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.

smacdonald2008
New Participant
June 8, 2018

Here is JS event code example  -- JavaScript DOM EventListener

arunpatidar
New Participant
June 8, 2018

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

Thanks

Arun

Arun Patidar
cquser1
cquser1Author
New Participant
June 7, 2018

Hi Arun,

Thank you for your reply.

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

cquser1
cquser1Author
New Participant
June 7, 2018

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'.

arunpatidar
arunpatidarAccepted solution
New Participant
June 7, 2018

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
smacdonald2008
New Participant
June 7, 2018

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.

cquser1
cquser1Author
New Participant
June 7, 2018

Hi Arun,

Not sure if I got you.

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

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.

arunpatidar
New Participant
June 7, 2018

Hi,

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

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

Thanks

Arun

Arun Patidar