Results 1 to 3 of 3
  1. #1
    saqib is offline Member
    Join Date
    Jul 2008
    Posts
    2
    Rep Power
    0

    Default Struts2 :File upload and div on same form

    Hi,

    I am trying to use ajax div and file control in same form. But div is not loading properly instead it shows [object HTMLDocument] on firefox and [object] on IE. But if I try to use them separately then both are working fine. Anyone has has any idea what is happening ??? Here is the code
    /************************************************** ************************************************** *********


    Java Code:
    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
     <%@ taglib prefix="s" uri="/struts-tags" %>
     <html>
     <head>
     <s:head theme="ajax" />
     <link href="<s:url value="/css/campaign.css"/>" rel="stylesheet"
       type="text/css"/> 
         <title>upload and ajax test</title>
     </head>
     <script>
      function changeApplication()
      {
            dojo.event.topic.publish("change_Application");
      }
      </script>
     <body>
     <s:url id="updateSecondList" action="updateSecondList" />
       
        <s:actionerror />
        <s:fielderror />
         <s:form id="test_form" name="test_form" action="FileAction" method="POST" theme="ajax" enctype="multipart/form-data">
         
             <s:select
                 label="First List"
                list="firstList"
                name="selectedItem"
                onchange="javascript:changeApplication();return false;">
            </s:select>
           
            <tr>
            <td class="tdLabel"><label class="label">Second List</label></td>
            <td>
            <s:div showLoadingText="false"
                 id="details" href="%{updateSecondList}" theme="ajax"
                 listenTopics="change_Application" formId="test_form">
             </s:div>                           
            </td>
            </tr>
           
            <s:file name="upload" label="File"/>
            <s:submit />
         </s:form>
     </body>
     </html>
    /************************************************** ************************************************** *****/
    Regards

  2. #2
    aRZee is offline Member
    Join Date
    Aug 2008
    Posts
    1
    Rep Power
    0

    Default

    Helllo,

    I was wondering if you ever found a solution to your problem or a workaround maybe?

    I'm having the same problem and cant seem to get it too workk .

    Thanx in advance,

    aRZee

  3. #3
    saqib is offline Member
    Join Date
    Jul 2008
    Posts
    2
    Rep Power
    0

    Default

    No dear I could not find any solution so drop the idea of using AJAX on that page

Similar Threads

  1. how to upload a file?
    By tommy in forum JavaServer Pages (JSP) and JSTL
    Replies: 4
    Last Post: 06-30-2008, 03:50 PM
  2. file upload
    By sundarjothi in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 06-27-2008, 12:52 PM
  3. upload file validations
    By call_sreenu in forum Java Servlet
    Replies: 0
    Last Post: 06-10-2008, 11:05 AM
  4. File Upload
    By ShoeNinja in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 11-09-2007, 11:09 PM
  5. how to upload a file along with html form data
    By pranith in forum Java Servlet
    Replies: 3
    Last Post: 07-30-2007, 03:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •