modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-param-window-parameter.ftl
author Martin Taal <martin.taal@openbravo.com>
Wed, 08 Jan 2014 04:00:39 +0100
changeset 21750 e7bddfad3ae2
parent 20546 9dd28d0846af
child 23103 168387ae253d
permissions -rw-r--r--
Fixes issue 25371: Support list references in parameter windows
Read the valuemap from the database and show it in the process window for a list reference
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@20538
    15
 * All portions are Copyright (C) 2012-2013 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@20544
    28
    
asier@20544
    29
  <#if param.type != "OBSectionItem">
asier@20544
    30
    paramId: '${param.id}',
augusto@19826
    31
    width: '${param.width?js_string}',
martin@21750
    32
    <#if param.valueMapPresent>
martin@21750
    33
    valueMap: {
martin@21750
    34
    <#list param.valueMap as valueMapValue>
martin@21750
    35
      '${valueMapValue.key?js_string}': '${valueMapValue.value?js_string}'<#if valueMapValue_has_next>,</#if>
martin@21750
    36
    </#list>
martin@21750
    37
    },
martin@21750
    38
    </#if>
augusto@19441
    39
    <#if param.redrawOnChange>
augusto@19441
    40
      redrawOnChange: true,
augusto@19441
    41
    </#if>
augusto@19441
    42
    <#if param.showIf != "" >
augusto@19441
    43
      showIf: function(item, value, form, currentValues, context) {
augusto@19441
    44
        return (${param.showIf});
augusto@19441
    45
      },
augusto@19441
    46
    </#if>
asier@20545
    47
    <#if param.readOnlyIf != "" >
asier@20545
    48
      readOnlyIf: function(currentValues) {
asier@20545
    49
        return (${param.readOnlyIf});
asier@20545
    50
      },
asier@20545
    51
    </#if>
asier@20546
    52
    <#if param.length != -1>
asier@20546
    53
      length: ${param.length},
asier@20546
    54
    </#if>
asier@19270
    55
    required: ${param.required?string}
asier@19263
    56
    ${param.parameterProperties}
asier@20544
    57
  <#else>
asier@20544
    58
    defaultValue: '${param.title?js_string}',
asier@20544
    59
    sectionExpanded: ${param.expanded?string},
asier@20544
    60
    itemIds: [
asier@20544
    61
    <#list param.children as childParam>
asier@20544
    62
      '${childParam.dBColumnName?js_string}'<#if childParam_has_next>,</#if>
asier@20544
    63
    </#list>
asier@20544
    64
    ]
asier@20544
    65
  </#if>
asier@19261
    66
}
asier@19261
    67
</#macro>