change field visibility based on a drop down list value

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

0 votes

3 answers

4456 views

ANSWER



1 votes



1 votes



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>
1 votes