Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Hi, try to check your browser developer console for error messages. There is likely to be some JavaScript error causing the page to stop loading.
Hello I am creating a plugin to personalize the search filter of a datalist I deployed my plugin in joget server but when I choose it to configure the input the screen freezes without having errors
if you choose this plugin the screen stays like this :
Java class :
public class FieldDataListFilterType extends DataListFilterTypeDefault implements PwaOfflineResources {
public String getName() {
return "Field Data List Filter Type2";
}
public String getVersion() {
return "5.0.0";
}
public String getDescription() {
return "Data List Filter Type2 - Field";
}
public String getLabel() {
return "Date";
}
public String getClassName() {
return this.getClass().getName();
}
public String getPropertyOptions() {
return AppUtil.readPluginResource(getClass().getName(), "/properties/datalist/fieldDataListFilterType.json", null, true, null);
}
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(), "/ressources/templates/datePicker.ftl", null);
}
public DataListFilterQueryObject getQueryObject(DataList datalist, String name) {
DataListFilterQueryObject queryObject = new DataListFilterQueryObject();
String value = getValue(datalist, name, getPropertyString("defaultValue"));
if (datalist != null && datalist.getBinder() != null && value != null && !value.isEmpty()) {
String cname = datalist.getBinder().getColumnName(name);
//support aggregate function
if (cname.toLowerCase().contains("count(")
|| cname.toLowerCase().contains("sum(")
|| cname.toLowerCase().contains("avg(")
|| cname.toLowerCase().contains("min(")
|| cname.toLowerCase().contains("max(")) {
queryObject.setQuery(cname + " = ?");
queryObject.setValues(new String[]{value});
} else {
queryObject.setQuery("lower(" + cname + ") like lower(?)");
queryObject.setValues(new String[]{'%' + value + '%'});
}
return queryObject;
}
return null;
}
@Override
public Set<String> getOfflineStaticResources() {
Set<String> urls = new HashSet<String>();
String contextPath = AppUtil.getRequestContextPath();
urls.add(contextPath + "/plugin/org.joget.apps.datalist.lib.TextFieldDataListFilterType/js/jquery.placeholder.min.js");
return urls;
}
fieldDataListFilterType.json:
[{
title:'@@datalist.tfdlft.config@@',
properties:[
{
name:'defaultValue',
label:'@@datalist.tfdlft.defaultValue@@',
type:'datepicker'
}
]
}
]