Skip to main content
1-Visitor
January 24, 2017
Question

Hide an attribute on layout customization?

  • January 24, 2017
  • 2 replies
  • 3772 views

Hello everyone,

I have to hide an attribute on a layout when another attribute change the value.

for exemple :

Attribute A : boolean

Attribue B : String

If attribute A is false, Attribute B is hidden on the layout.

Thanks,

A.B

2 replies

5-Regular Member
January 25, 2017

I think you can't hide attribute, but you can make Attribute 2 not editable thanks Data Utility.

abennis1-VisitorAuthor
1-Visitor
January 26, 2017

Thanks for you reply

I found out a method preValidateAttribute in DefaultUIComponentValidator, i found no documentation about that. But i will try to use this validator on my attribute.

16-Pearl
January 31, 2017

Hi Anas Bennis‌,

It is ok if we make second attribute non-editable on editable and it depends on first attribute value we select?

For example:

IBA Not Editable.jpg

I remember I had done something like this in recent past. If that is ok for you I can again give it a try and share my findings.

Regards,

Shirish

6-Contributor
July 20, 2023

Hi @ShirishMorkhade_238755,

 

Can you explain me how you did that? 

It'll help me a lot.

 

Thanks

HelesicPetr
22-Sapphire II
22-Sapphire II
July 20, 2023

Hi @Mehmet_Ozdemir 

I believe that there are many ways how to do so. 

 

One is to use js scripts to change the attribute input field properties as a hidden, disabled and so on.

 

All you can done in JSP pages of your wizard.

 

example of the checkbox 

it reacts on a mouse click

<wrap:checkBox name="CADDocument" id="CADDocument" label="CAD Document" renderLabel="true"
renderExtra="enabled"
renderLabelOnRight="true" checked="true" onclick="defineCADType('CADDocument')"/>

example of the script

<script type="text/javascript">
 function defineCADType(buttonPushed) {
 var checked =document.getElementById('CADDocument').checked;
 if (checked !== true)
 {
 document.getElementById('prt').hidden = true;
 document.getElementById('asm').hidden = true;
 document.getElementById('drw').hidden = true;
 }else{
 document.getElementById('prt').hidden = false;
 document.getElementById('asm').hidden = false;
 document.getElementById('drw').hidden = false;
 }
 }
</script>

 

in your case you can set onChange event on a textbox

 

PetrH