Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Hello,
I ended up using this, which works :
public class IcaosListAjaxFormBinder extends FormBinder implements FormLoadBinder, FormLoadMultiRowElementBinder {
public FormRowSet load(Element element, String primaryKey, FormData formData) {
FormRowSet names = new FormRowSet();
String processId = formData.getProcessId();
if (primaryKey != null && processId!= null && !primaryKey.equals(processId)) {
//primaryKey != processId on AJAX loading because
//primaryKey == manualName on AJAX loading
RawPagesDao rawpagesdao = (RawPagesDao) AppContext.getInstance().getAppContext().getBean("rawPagesDao");
Set<String> dataFromDB = rawpagesdao.getDatasFromManual(formData.getProcessId(), primaryKey);
FormRow dataEntry = new FormRow();
JSONStringer datasList = new JSONStringer();
try {
datasList.array();
for (String dataName : dataFromDB) {
datasList.object().key("dataName").value(dataName).key("selected").value(false).endObject();
}
datasList.endArray();
dataEntry.put("generationRequirementsNames", datasList.toString());
} catch (JSONException ex) {
LogUtil.error(getClassName(), ex, String.format("Encountered a JSON error: %s", ex.getMessage()));
}
names.add(dataEntry);
}
return names;
}
//Add overriding stuff here
}
Regards,
Raphaël
Hello,
I'm working with an external database.
I succeeded importing fields for a select box creating my own FormOptionsBinder plugin.
Now I want to populate a spreadsheet (possibly in an Ajax subform if it helps) according to the selected value.
I think I have to create my own load binder for this purpose, but I can't find which class I must inherit from or which interfaces I must implement. Do you have any examples of spreadsheet load binders?
Regards,
Raphaël