Hey all,
I am new to vCO and JSP. Now I am coding a config page on that user can upload files.
The code looks like:
<s:form action="SaveInstance" method="POST" validate="true" enctype="multipart/form-data" onsubmit="return checkAddress();">
<input type="file" name="filename" value="file.name" />
<tr>
<td><s:submit type="input" name="submitButton"
key="save.button" />
<s:submit type="input" name="submitButton" value="Cancel"
onclick="javascript:cancelForm('click')" />
</td>
</tr>
<s:hidden name="onCancelClicked" value="" />
</s:form>
function cancelForm(fieldVal) {
document.forms[0].onCancelClicked.value = fieldVal;
}
When clicking the "Cancel" or "Save" button, page will navigate back.
Action class:
if ((this.onCancelClicked != null)
&& (this.onCancelClicked.equals("click"))) {
return "cancel";
}
However when navigating back, the destination page style is disappeared.
The url changes from https://myip/config_general/General.action to https://myip/myplugin/SaveInstance.action.
Image may be NSFW.
Clik here to view.
Below is the correct screenshot as expected. Note that the left function selection is disappeared either.
Image may be NSFW.
Clik here to view.
I trid to remove enctype="multipart/form-data" from the form tag, and the page style was back, but upload function cannot work.
I am appreciated if anybody has the idea of this problem.