• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ajax form submission issue with struts 2 file tag

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Ajax form submission does NOT occur if it contains a struts2-file tag (the form gets submitted and expected content correctly shows up in the target div IFF the file tag is removed). Code snippet below where I've prefixes, 's','sx' defined for 'struts-tags','struts-dojo-tags' respectively and 'sx:head' inside <head> tag.
Struts2 versions: (struts 2.1.8,struts2-dojo-plugin-2.1.6.jar).

----------------------------
<s:form theme="simple" method="post" id="f2" enctype="multipart/form-data" >
<table>
<tr>
<td>
<s:select name="dummyDay" list="%{DummyDays}" cssClass="tdfont" onchange="javascript:dojo.event.topic.publish('showVendorDetail')" />
</td>
<td>
<s:file id="xx" name="yy" cssClass="tdfont" />
</td>
</tr>
</table>
<s:url id="d_url" action="loadvndrwebsite" />
<sx:div id="vendorDetails" href="%{d_url}" autoStart="false" listenTopics="showVendorDetail" updateFreq="100" formId="f2">
</sx:div>
</s:form>
----------------------------

Thanks much,
Sayan
 
Ranch Hand
Posts: 182
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is not an issue, this is the default/expected behavior. If it is supported, then "ajax file upload" will become very easy. (I think file uploaded is not supported because JavaScript code do not have access to the file data)
I tried the same few months before and at the end of the day I came to above conclusion. At last I did it by using frames (Even though it looks like ajax file upload, But technically it is not).

Also please use code tags. And welcome to java ranch
 
A wop bop a lu bob a womp bam boom. Tutti frutti ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic