Skip to content

Commit

Permalink
Fixed: wflow-core - Hash variable is processed at design time in Form…
Browse files Browse the repository at this point in the history
… Builder #278

git-svn-id: http://dev.joget.org/svn/jw-community/trunk@65 1bff935d-2fe2-40b7-b00f-c2aca69a7612
  • Loading branch information
owen committed Jul 29, 2011
1 parent c216d0c commit c59fe27
Showing 1 changed file with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public String previewElement(String json) {
* @return
*/
public String previewElement(String json, boolean includeMetaData) {
Element element = createElementFromJson(json);
Element element = createElementFromJson(json, !includeMetaData);
FormData formData = new FormData();
String html = "";
try {
Expand All @@ -57,17 +57,30 @@ public String previewElement(String json, boolean includeMetaData) {
}
return html;
}

/**
* Creates an element object from a JSON definition
* @param formJson
* @return
*/
public Element createElementFromJson(String elementJson) {
return createElementFromJson(elementJson, true);
}

/**
* Creates an element object from a JSON definition
* @param formJson
* @param processHashVariable
* @return
*/
public Element createElementFromJson(String elementJson, boolean processHashVariable) {
try {
String processedJson = elementJson;
// process hash variable
String processedJson = AppUtil.processHashVariable(elementJson, null, null, null);

if(processHashVariable){
processedJson = AppUtil.processHashVariable(elementJson, null, null, null);
}

// instantiate element
Element element = FormUtil.parseElementFromJson(processedJson);
return element;
Expand Down

0 comments on commit c59fe27

Please sign in to comment.