Deborah White
2018-06-21 21:55:11 UTC
Hello, I'm hoping someone with more experience can help me with this. When I do the file upload, it uploads the file and returns to the page (but it looks like it breaks out of the view it was in) but then the Add button does not work. I believe I need to be able to post data to my action class that is handling the file upload? Please see my jsp code:
<%@taglib uri="/struts-tags" prefix="s" %>
<script type="text/javascript">
function addBulkSellerAgent() {
var registrationId = '<s:property value="registrationId"/>';
var sellerId = '<s:property value="sellerId"/>';
var fileFileName = '<s:property value="fileFileName"/>';
var fromPage = 'sellerAgent';
var postData = "registrationId="+registrationId+
"&sellerAgentData.sellerId=" + sellerId+
"&fromPage=" + fromPage +
"&fileFileName=" + fileFileName;
processRegistrationDetails('<s:url value="addBulkSellerAgents.action" encode="true"/>', postData);
return false;
}
</script>
<h3>Select File to Upload</h3>
<s:form action="UploadFile" method="post" enctype="multipart/form-data">
<s:file label="File" name="file"></s:file>
<s:submit value="Upload"></s:submit>
</s:form>
<form name="sellerAgentForm" id="sellerAgentForm" ENCTYPE="multipart/form-data" action="" method="post">
<div id="PageContainer">
<div id="container" style="margin: 0 0 0 137px;">
<h1 class="page-title">
</h1>
<div class="clientSideError" id="clientSideError"></div>
<fieldset style="width:670px;">
<legend>Add Seller Agents</legend>
<body>
</fieldset>
<br>
<table border="0" cellpadding="0" cellspacing="0" width="642" style="margin:5px">
<tr>
<td align="center">
<input id="button_save" class="button" type="button" value="Add" name="button_save" onclick="return addBulkSellerAgent();" />
<%--<input id="button_reset1" class="button" type="button" value="Reset" name="button_reset1" onclick="return doSellerAgentFormClear();"/>--%>
<input id="button_exit" class="button" type="button" value="Cancel" name="button_exit" onclick="displayRegistrationDetails('<s:url value="registrationView.action" encode="true"><s:param name="registrationId" value="%{registrationId}"/><s:param name="fromPage" value="%{fromPage}"/></s:url>');" />
  
<span id="StatusMessage" class="statusMessage"></span>
</td>
</tr>
</table>
<br>
</div>
</div>
</form>
CONFIDENTIALITY NOTICE: This communication with its contents may contain confidential and/or legally privileged information. It is solely for the use of the intended recipient(s). Unauthorized interception, review, use or disclosure is prohibited and may violate applicable laws including the Electronic Communications Privacy Act. If you are not the intended recipient, please contact the sender and destroy all copies of the communication.
<%@taglib uri="/struts-tags" prefix="s" %>
<script type="text/javascript">
function addBulkSellerAgent() {
var registrationId = '<s:property value="registrationId"/>';
var sellerId = '<s:property value="sellerId"/>';
var fileFileName = '<s:property value="fileFileName"/>';
var fromPage = 'sellerAgent';
var postData = "registrationId="+registrationId+
"&sellerAgentData.sellerId=" + sellerId+
"&fromPage=" + fromPage +
"&fileFileName=" + fileFileName;
processRegistrationDetails('<s:url value="addBulkSellerAgents.action" encode="true"/>', postData);
return false;
}
</script>
<h3>Select File to Upload</h3>
<s:form action="UploadFile" method="post" enctype="multipart/form-data">
<s:file label="File" name="file"></s:file>
<s:submit value="Upload"></s:submit>
</s:form>
<form name="sellerAgentForm" id="sellerAgentForm" ENCTYPE="multipart/form-data" action="" method="post">
<div id="PageContainer">
<div id="container" style="margin: 0 0 0 137px;">
<h1 class="page-title">
</h1>
<div class="clientSideError" id="clientSideError"></div>
<fieldset style="width:670px;">
<legend>Add Seller Agents</legend>
<body>
</fieldset>
<br>
<table border="0" cellpadding="0" cellspacing="0" width="642" style="margin:5px">
<tr>
<td align="center">
<input id="button_save" class="button" type="button" value="Add" name="button_save" onclick="return addBulkSellerAgent();" />
<%--<input id="button_reset1" class="button" type="button" value="Reset" name="button_reset1" onclick="return doSellerAgentFormClear();"/>--%>
<input id="button_exit" class="button" type="button" value="Cancel" name="button_exit" onclick="displayRegistrationDetails('<s:url value="registrationView.action" encode="true"><s:param name="registrationId" value="%{registrationId}"/><s:param name="fromPage" value="%{fromPage}"/></s:url>');" />
  
<span id="StatusMessage" class="statusMessage"></span>
</td>
</tr>
</table>
<br>
</div>
</div>
</form>
CONFIDENTIALITY NOTICE: This communication with its contents may contain confidential and/or legally privileged information. It is solely for the use of the intended recipient(s). Unauthorized interception, review, use or disclosure is prohibited and may violate applicable laws including the Electronic Communications Privacy Act. If you are not the intended recipient, please contact the sender and destroy all copies of the communication.