JTraining Blog

A short description about your blog
Tags >> ExtJS
itajun
itajun

The standard way to tackle AJAX calls with JSON results in my current project uses an extended version of Spring’s JsonView class. It worked quite well until I used an ExtJS FormPanel with the property fileUpload set to true. Have a look at the code bellow and then I’ll describe the problem.

The panel looks like:

var uploadOuterPanel = new Ext.FormPanel( {
fileUpload :true,
// Other properties omitted
items : {
allowBlank :false,
id :'file',
inputType :'file',
name :'myFile',
fieldLabel :'File',
blankText :'Please choose a file',
anchor :'95%',
required :true,
autoShow :true,
xtype :'textfield'
},
buttonAlign: 'left',
buttons : [ {
text :'Upload',
handler : function() {
if (uploadOuterPanel.getForm().isValid()) {
uploadOuterPanel.getForm().submit( {
url :'',
waitMsg :'Uploading your file...',
success : function(form, action) {
Ext.Msg.alert('Success', 'File processed successfuly!');
},
failure : // Handle failure omitted
});
}
}
} ]
});

The Controller looks like:
































Tagged in: Spring , ExtJS

Tags:

1.4 M1 2.1.1 6.10 2010 6.9.1 97 things Access Program advanced Agile Ajax Ajax4JSF Algorithms Applet applications Atlanta Atmosphere Audit available BDD beginner Behaviour beta blind BPM Build bus C# Cache Caching Certification Cloud Cloud computing code code to coast collection Computing Continuous Integration Database Databinding DC Debugging Develop developer development dienst download Driven Early Eclipse Editor EJB Enterprise event Events ExternalNews ExtJS Extreme Programming Facelets features Flex Flight recorder Framework Frameworks free GlassFish Grid Groovy Hat HD Hello World Hibernate HowTo ICT IDE IDEA installation Integration IntelliJ introduction iPhone Java Java EE Java EE 6 java road trip Java SE Java SE 6 JavaFX JavaFX Composer javascript JavaZone jaxws JBehave JBoss JDK 7 JetBrains JNI JPA jQuery JRebel JRebel 3.0 JRockit JRockit Mission Control JSF JSON JTraining jtraining.com JVM klant know lady Leak library license Lift Loom Lucene M1 Mark Maven Memory Milestone 1 milestones mkb music Netbeans NTNU oJava OOP Open Open Source Oracle ORM oslo patch 7 Performance PHP Plugin prizes programmer programming project project management Puzzles QA RAP Red Reflection Reinhold related Release Reuse Rich Ajax Platform RichFaces Road SaaS sample Scala Scaling Script Scrum Seam Server should soap software Software as a Service Source Spring Spring Web Flow SQL String Student Sun sweepstakes Swing Teaching Testing tools Tour Training Transaction Tutorial Update 21 validation video web Web applications web service Web Services Weblogic wiki XP

Sponsers