Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
A useable List Filter Type plugin must extends org.joget.apps.datalist.model.DataListFilterTypeDefault abstract class.
Under wflow-core module
Extended org.joget.plugin.base.ExtDefaultPlugin. Please refer to Plugin Base Abstract Class and Interface.
Implemented org.joget.plugin.property.model.PropertyEditable. Please refer to Plugin Base Abstract Class and Interface.
A base abstract class to develop a Datalist Filter Type plugin.
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.
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.
public java.lang.String getValue(org.joget.apps.datalist.model.DataList datalist, java.lang.String name)
Convenience method to get value from request parameters.
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 emptypublic java.lang.String[] getValues(org.joget.apps.datalist.model.DataList datalist, java.lang.String name)
Convenience method to get values from request parameters.
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.Please refer to Plugin Properties Options for more information.
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); }
<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>
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)