Skip to content

Commit

Permalink
Fixed: wflow-core - Form - Form Load/Options Binder get executed in n…
Browse files Browse the repository at this point in the history
…o permission section. #5487 @6.0-SNAPSHOT
  • Loading branch information
owen-joget committed Apr 3, 2018
1 parent 1256295 commit 8792b8a
Showing 1 changed file with 26 additions and 22 deletions.
48 changes: 26 additions & 22 deletions wflow-core/src/main/java/org/joget/apps/form/service/FormUtil.java
Expand Up @@ -392,18 +392,20 @@ public static FormData executeOptionBinders(Element element, FormData formData)
if (formData == null) {
formData = new FormData();
}
FormLoadBinder binder = (FormLoadBinder) element.getOptionsBinder();
if (binder != null && !isAjaxOptionsSupported(element, formData)) {
String primaryKeyValue = (formData != null) ? element.getPrimaryKeyValue(formData) : null;
FormRowSet data = binder.load(element, primaryKeyValue, formData);
if (data != null) {
formData.setOptionsBinderData(binder, data);
if (element.isAuthorize(formData)) {
FormLoadBinder binder = (FormLoadBinder) element.getOptionsBinder();
if (binder != null && !isAjaxOptionsSupported(element, formData)) {
String primaryKeyValue = (formData != null) ? element.getPrimaryKeyValue(formData) : null;
FormRowSet data = binder.load(element, primaryKeyValue, formData);
if (data != null) {
formData.setOptionsBinderData(binder, data);
}
}
}
Collection<Element> children = element.getChildren(formData);
if (children != null) {
for (Element child : children) {
FormUtil.executeOptionBinders(child, formData);
Collection<Element> children = element.getChildren(formData);
if (children != null) {
for (Element child : children) {
FormUtil.executeOptionBinders(child, formData);
}
}
}
return formData;
Expand All @@ -419,18 +421,20 @@ public static FormData executeLoadBinders(Element element, FormData formData) {
if (formData == null) {
formData = new FormData();
}
FormLoadBinder binder = (FormLoadBinder) element.getLoadBinder();
if (!(element instanceof AbstractSubForm) && binder != null) {
String primaryKeyValue = (formData != null) ? element.getPrimaryKeyValue(formData) : null;
FormRowSet data = binder.load(element, primaryKeyValue, formData);
if (data != null) {
formData.setLoadBinderData(binder, data);
if (element.isAuthorize(formData)) {
FormLoadBinder binder = (FormLoadBinder) element.getLoadBinder();
if (!(element instanceof AbstractSubForm) && binder != null) {
String primaryKeyValue = (formData != null) ? element.getPrimaryKeyValue(formData) : null;
FormRowSet data = binder.load(element, primaryKeyValue, formData);
if (data != null) {
formData.setLoadBinderData(binder, data);
}
}
}
Collection<Element> children = element.getChildren(formData);
if (children != null) {
for (Element child : children) {
FormUtil.executeLoadBinders(child, formData);
Collection<Element> children = element.getChildren(formData);
if (children != null) {
for (Element child : children) {
FormUtil.executeLoadBinders(child, formData);
}
}
}
return formData;
Expand Down

0 comments on commit 8792b8a

Please sign in to comment.