modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-param-window-parameter.ftl
author Augusto Mauch <augusto.mauch@openbravo.com>
Fri, 25 Jan 2013 11:29:52 +0100
changeset 19441 a0d95d50e44c
parent 19270 0e50a16fada1
child 19826 b6d27173f383
permissions -rw-r--r--
[pw] Adds display logic to the process parameters

Summary of the changes:
- OBUIAPP_PARAMETER.xml: Creation of the displaylogic column in the database
- AD_COLUMN.xml, AD_FIELD.xml: Definition of the new column and field in the application dictionary
- DynamicExpressionParser.java: Adapts the expression parser to work with process parameters. As opposed with other fields, the parsing of process parameter e
xpression require the Process instead of the Tab.
- ob-param-window-parameter.ftl: Adds the showIf and the redrawOnChange properties to the process parameters. The parameters used by other parameters in their
display logic will have redrawOnChange=true, so every time they are modified the showIf expressions are evaluated.
- OBViewParameterHandler.java: Processes the display logic of the parameters, and determine if parameters are referenced in other parameters' display logic.
- ob-parameter-window-view.js: Adds evaluation of the display logic of the process parameters in the client.
- ob-smartclient.js: Adds some checks in the changed function to prevent executing a function in an undefined object.
asier@19261
     1
<#--
asier@19261
     2
/*
asier@19261
     3
 *************************************************************************
asier@19261
     4
 * The contents of this file are subject to the Openbravo  Public  License
asier@19261
     5
 * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
asier@19261
     6
 * Version 1.1  with a permitted attribution clause; you may not  use this
asier@19261
     7
 * file except in compliance with the License. You  may  obtain  a copy of
asier@19261
     8
 * the License at http://www.openbravo.com/legal/license.html
asier@19261
     9
 * Software distributed under the License  is  distributed  on  an "AS IS"
asier@19261
    10
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
asier@19261
    11
 * License for the specific  language  governing  rights  and  limitations
asier@19261
    12
 * under the License.
asier@19261
    13
 * The Original Code is Openbravo ERP.
asier@19261
    14
 * The Initial Developer of the Original Code is Openbravo SLU
asier@19261
    15
 * All portions are Copyright (C) 2012 Openbravo SLU
asier@19261
    16
 * All Rights Reserved.
asier@19261
    17
 * Contributor(s):  ______________________________________.
asier@19261
    18
 ************************************************************************
asier@19261
    19
*/
asier@19261
    20
asier@19261
    21
-->
asier@19261
    22
asier@19261
    23
<#macro createParameter param>
asier@19261
    24
{
asier@19261
    25
    type: '${param.type}',
asier@19261
    26
    title: '${param.title?js_string}',
asier@19261
    27
    name: '${param.name?js_string}',
asier@19270
    28
    width: '*',
augusto@19441
    29
    <#if param.redrawOnChange>
augusto@19441
    30
      redrawOnChange: true,
augusto@19441
    31
    </#if>
augusto@19441
    32
    <#if param.showIf != "" >
augusto@19441
    33
      showIf: function(item, value, form, currentValues, context) {
augusto@19441
    34
        return (${param.showIf});
augusto@19441
    35
      },
augusto@19441
    36
    </#if>
asier@19270
    37
    required: ${param.required?string}
asier@19263
    38
    ${param.parameterProperties}
asier@19261
    39
}
asier@19261
    40
</#macro>