Hiding specific tabs in multi-attribute cells inside forms, easier way to do it?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
joben
Posts: 230
Joined: Wed Nov 06, 2019 9:49 pm
Location: Sweden
Contact:

Hiding specific tabs in multi-attribute cells inside forms, easier way to do it?

Post by joben »

forms1.png
forms1.png (3.2 KiB) Viewed 19639 times
Lets say I want to hide one of the tabs in a so called "multi-attribute cell" (the red one) based on a yes/no field in SystemSettings.
If it was a form section (blue tabs), this would be piece of cake. I would just have to use "Not present when" and point it to a SystemSettings attribute like: SystemSettings.ShowTechnicalObservations<>'Yes'

But because this is a "multi-attribute cell" setting, there is no such option.
Presentation rules: They are only for grid rows.
READ PROTECT rules: Will only hide records of a BO, not a tab.

So what we are left with is javascript and CSS.

This is what we came up with:

1. Set the icon class for the tab which you want to conditionally hide like: fa fa-table technicalObservations
This is so that we have some sort of way to refer to the correct tab.

2. Use a render script for the form: (credit: Margor)

Code: Select all

let variable='<<SystemSettings.ShowTechnicalObservations>>'
 
if(variable!='Yes'){

$( "span:has(.technicalObservations)" ).addClass( "hideIt" );
 
}
3. Write this in the CSS file for the application:

Code: Select all

/*Code for hiding stuff*/
.hideIt{display:none !important;}
/**/
This will work, but it feels like there should be a simpler way to do it. Am I missing something?
Regards, Joakim

Image
ACDC
Posts: 1142
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Re: Hiding specific tabs in multi-attribute cells inside forms, easier way to do it?

Post by ACDC »

But because this is a "multi-attribute cell" setting, there is no such option.
Presentation rules: They are only for grid rows.
READ PROTECT rules: Will only hide records of a BO, not a tab.
READ PROTECT rules: Will only hide records of a BO, not a tab.
I am working with a similar requirement and READ PROTECT on the attribute in the tab (red TAB example) does hide the tab.
Post Reply