Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Usages

用法

...

抽象类

org.joget.apps.datalist.model.DataListFilterTypeDefault

Method Detail

...

  • 一个开发Datalist Filter Type插件的基础抽象类。

方法细节

抽象方法
getTemplate
public java.lang.String getTemplate(org.joget.apps.datalist.model.DataList datalist, java.lang.String name, java.lang.String label)

HTML template of the filter.获取 已经过滤的 HTML template 

getQueryObject
public org.joget.apps.datalist.model.DataListFilterQueryObject getQueryObject(org.joget.apps.datalist.model.DataList datalist, java.lang.String name)

Condition and parameters to construct query.

...

条件和参数构造查询。

实用方法
getValue
public java.lang.String getValue(org.joget.apps.datalist.model.DataList datalist, java.lang.String name)

Convenience method to get value from request parameters.从请求参数中获取值的简便方法

getValue
public java.lang.String getValue(org.joget.apps.datalist.model.DataList datalist, java.lang.String name, java.lang.String defaultValue)

Convenience method to get value from request parameters.

从请求参数中获取值的简便方法

如果为空,返回 默认值Return default value if empty

getValues
public java.lang.String[] getValues(org.joget.apps.datalist.model.DataList datalist, java.lang.String name)

Convenience method to get values from request parameters.从请求参数中获取多个值的简便方法

getValues
public java.lang.String[] getValues(org.joget.apps.datalist.model.DataList datalist, java.lang.String name, java.lang.String defaultValue)

Convenience method to get values from request parameters.

Return default values if empty. default values can be separated by semicolon ";" if multiple value.

Plugin Properties Options

从请求参数中获取多个值的简便方法

如果为空,返回 默认值 . 如果是多个值,以分号分割。

插件属性选项

Datalist Filter Type

...

插件模板代码

以下是文本字段过滤器类型的示例模板 . 它使用 FreeMaker 语法. 该模板将被getTemplate  方法使用并返回 Following is a sample template of a Text Field Filter Type. It is constructed using FreeMaker syntax. This template will be used and returned by Datalist Filter Type Plugin method.

Code Block
languagexml
    public String getTemplate(DataList datalist, String name, String label) {
        PluginManager pluginManager = (PluginManager) AppUtil.getApplicationContext().getBean("pluginManager");
        Map dataModel = new HashMap();
        dataModel.put("name", datalist.getDataListEncodedParamName(DataList.PARAMETER_FILTER_PREFIX+name));
        dataModel.put("label", label);
        dataModel.put("value", getValue(datalist, name, getPropertyString("defaultValue")));
        dataModel.put("contextPath", WorkflowUtil.getHttpServletRequest().getContextPath());
        return pluginManager.getPluginFreeMarkerTemplate(dataModel, getClassName(), "/templates/textFieldDataListFilterType.ftl", null);
    } 
Code Block
languagexml
<script type="text/javascript" src="${contextPath}/plugin/org.joget.apps.datalist.lib.TextFieldDataListFilterType/js/jquery.placeholder.min.js"></script>
<input id="${name!}" name="${name!}" type="text" size="10" value="${value!?html}" placeholder="${label!?html}"/>
<script type="text/javascript">
    $(document).ready(function(){
        $('#${name!}').placeholder();
    });
</script>

Explanations

说明

  • 没有指定格式需要遵循
  • 确保过滤器输入名称是从 datalist
  • There are no specify format need to follow.
  • Please make sure that the filter input name is the value get from datalist.getDataListEncodedParamName(DataList.PARAMETER_FILTER_PREFIX+name) 获取的值。.

...

教程

...

相关社区版插件

  • Text Field Data List Filter Type
    org.joget.apps.datalist.lib.TextFieldDataListFilterType (wflow-core)