anchor.diff:  		}
   	}
   	
  -	
  -	 if(dossierFile != null && Validator.isNotNull(dossierFile.getFormData())){
  -		 InputStream stream = new ByteArrayInputStream(formData.getBytes(StandardCharsets.UTF_8));
  -			
  -			JsonDataSource dataSource = new JsonDataSource(stream);
  -
  -			
  -			InputStream template = new ByteArrayInputStream(dossierPart.getFormReport().getBytes(StandardCharsets.UTF_8));
  -			JasperReport jasperReport = JasperCompileManager.compileReport(template);
  -
  -		    JasperPrint jrPrint = JasperFillManager.fillReport(jasperReport, null, dataSource);
  -
  -		    JasperExportManager.exportReportToPdfFile(jrPrint, "/home/trungnt/test.pdf");
  -	} 
  -
  -	
   %>
   
  -<portlet:actionURL var="updateTempDynamicFormDataURL" name="updateTempDynamicFormData"/>
  +<portlet:actionURL var="updateDynamicFormDataURL" name="updateDynamicFormData"/>
  +
  +<%-- onSubmit='<%= "event.preventDefault(); " + renderResponse.getNamespace() + "saveDynamicFormData();" %>' --%>
   
   <aui:form 
  -	name="fm" action="<%=updateTempDynamicFormDataURL.toString() %>" 
  +	name="fm" action="<%=updateDynamicFormDataURL.toString() %>" 
   	method="post"
  -	onSubmit='<%= "event.preventDefault(); " + renderResponse.getNamespace() + "saveDynamicFormData();" %>'
   >
   	<aui:input name="redirectURL" type="hidden" value="<%=currentURL %>"/>
  -	<aui:input name="<%=DossierFileDisplayTerms.INDEX %>" type="hidden" value="<%=index %>"/>
  +	<aui:input name="<%=DossierDisplayTerms.DOSSIER_ID %>" type="hidden" value="<%=dossierId %>"/>
  +	<aui:input name="<%=DossierFileDisplayTerms.DOSSIER_FILE_ID %>" type="hidden" value="<%=dossierFileId %>"/>
   	<aui:input name="<%=DossierFileDisplayTerms.DOSSIER_PART_ID %>" type="hidden" value="<%=dossierPartId %>"/>
   	<aui:input name="<%=DossierFileDisplayTerms.FORM_DATA %>" type="hidden" value=""/>
   	<aui:fieldset id="dynamicForm"></aui:fieldset>
   	<aui:fieldset>
   		<aui:button type="button" value="save" name="save" cssClass="saveForm"/>
  +		<aui:button type="button" value="preview" name="preview"/>
  +		<aui:button type="button" value="create-file" name="create-file"/>
   	</aui:fieldset>
   </aui:form>
   
   <aui:script>
  -	var success = '<%=success%>';
   	var alpacaSchema = <%=alpacaSchema%>;
  -	var index = '<%=index%>';
  -	var dossierPartId = '<%=dossierPartId%>';
   	var formData = '<%=formData%>';
  +	var dossierFileId = '<%=dossierFileId%>';
   	
   	AUI().ready(function(A){
  -		if(success == 'true'){
  -			if(formData != ''){
  -				jsonData = JSON.parse(formData);
  -			}
  -			var responseData = new Object();
  -			responseData.index = index;
  -			responseData.dossierPartId = dossierPartId;
  -			responseData.formData = JSON.parse(formData);
  -			<portlet:namespace/>responseData(responseData);
  -		}
   		
   		if(alpacaSchema.options != 'undefined' && alpacaSchema.schema != 'undefined'){
   			
  
positive.code: 		try{
  			dossierFile = DossierFileLocalServiceUtil.getDossierFile(dossierFileId);
  		}catch(Exception e){
  			//nothing todo
  		}
  		
  		if(dossierFile != null && Validator.isNotNull(dossierFile.getFormData())){
  
negative.code: 	}
  	
  	String formData = StringPool.BLANK;
  
  	String alpacaSchema = dossierPart != null && Validator.isNotNull(dossierPart.getFormScript()) ? 
  			dossierPart.getFormScript() : PortletConstants.UNKNOW_ALPACA_SCHEMA;
  	
  	
  	DossierFile dossierFile = null;
  	
  