cancel
Showing results for 
Search instead for 
Did you mean: 

change field visibility based on a drop down list value

ITShine_
Star Contributor
Star Contributor

I'm using Nuxeo IDE and I'm looking for a way to show or hide a field based on a drop down list value

For example Drop down list values : A ; B If the Drop down list value is A the field should be hidden ; if the value is B the field should be visible and this visibility should be dynamically changed when the Drop down list values change

3 REPLIES 3

Not applicable

This an old post, but i figured I'd comment anyway.

One way to control this is by using polymer, this can be either disabled$= property or the hidden$= property. Example below from a metadata layout

<template>
<nuxeo-input role="widget" value="{{document.properties.myschemaName:myFieldName}}" label="Label" type="text"  disabled$="{{_disableField(document)}}"></nuxeo-input>

</template>

<script>
Polymer(
{ is: 'nuxeo-yourdoctype-layout',

behaviors: [Nuxeo.LayoutBehavior],

properties: {

	document: {
		type: Object,
	},
},

_disableField: function(doc) {

if(doc && doc.properties['shema_prefix:myField'] == "thisValue"){
	return true;
	}
	return false;
},
});
</script>

Gregory_Carlin
Elite Collaborator
Elite Collaborator