modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-form.js.ftl
changeset 28121 d9584faf499b
parent 28028 16d5a95d9323
child 28252 e91d7a38fa6b
equal deleted inserted replaced
28120:cca73bf2ef95 28121:d9584faf499b
    38             currentValues = isc.shallowClone(f.view.getCurrentValues()), otherItem,
    38             currentValues = isc.shallowClone(f.view.getCurrentValues()), otherItem,
    39             disabledFields, i;
    39             disabledFields, i;
    40             OB.Utilities.fixNull250(currentValues);
    40             OB.Utilities.fixNull250(currentValues);
    41         <#list data.fieldHandler.fields as field>
    41         <#list data.fieldHandler.fields as field>
    42         <#if field.readOnlyIf != "" && field.showIf == "">
    42         <#if field.readOnlyIf != "" && field.showIf == "">
    43         // Applying readonly.
    43         // Applying read only.
    44            f.disableItem('${field.name}', ${field.readOnlyIf});
    44            f.disableItem('${field.name}', ${field.readOnlyIf});
    45         <#elseif field.readOnlyIf == "" && field.showIf != "">
    45         <#else>
       
    46         <#if field.readOnlyIf == "" && field.showIf != "">
    46         // Applying display logic in grid.
    47         // Applying display logic in grid.
    47         if (!this.view.isShowingForm) {
    48         if (!this.view.isShowingForm) {
       
    49         <#if field.showIf == "false">
       
    50            f.disableItem('${field.name}', true);
       
    51         <#else>
    48            f.disableItem('${field.name}', (${field.showIf}) === false);
    52            f.disableItem('${field.name}', (${field.showIf}) === false);
       
    53         </#if>
    49         }
    54         }
    50         <#elseif field.readOnlyIf != "" && field.showIf != "">
    55         <#else>
    51         // Applying display logic and readonly in grid/form.
    56         <#if field.readOnlyIf != "" && field.showIf != "">
       
    57         // Applying display logic and read only in grid/form.
    52         if (!this.view.isShowingForm) {
    58         if (!this.view.isShowingForm) {
       
    59         <#if field.showIf == "false">
       
    60            // If display logic has a false value, it is only necessary take into account the read only logic.
       
    61            f.disableItem('${field.name}', (${field.readOnlyIf}));
       
    62         <#else>
    53            f.disableItem('${field.name}', (${field.readOnlyIf}) || (${field.showIf}) === false);
    63            f.disableItem('${field.name}', (${field.readOnlyIf}) || (${field.showIf}) === false);
       
    64         </#if>
    54         } else {
    65         } else {
    55            f.disableItem('${field.name}', ${field.readOnlyIf});
    66            f.disableItem('${field.name}', ${field.readOnlyIf});
    56         }
    67         }
       
    68         </#if>
       
    69         </#if>
    57         </#if>
    70         </#if>
    58         </#list>
    71         </#list>
    59         // disable forced in case the fields are set as read only per role
    72         // disable forced in case the fields are set as read only per role
    60         disabledFields = form.view.disabledFields;
    73         disabledFields = form.view.disabledFields;
    61         if (disabledFields) {
    74         if (disabledFields) {