0
我有一個導出表格,我可以從2個多維數據集導出數據。在表單提交之前,我想在隱藏字段中設置要導出的多維數據集的名稱,但它始終保留爲空。在javascript函數中,我添加了一個警報來顯示隱藏文件的值,這很好。但在行動中它是空值。s:隱藏提交前的設置值
JSP文件:
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<link rel="stylesheet"
href="<s:url value="/css/jquery.multiselect.css"/>" type="text/css" />
<link rel="stylesheet"
href="<s:url value="/css/jquery.multiselect.filter.css"/>"
type="text/css" />
<link rel="stylesheet"
href="<s:url value="/css/themes/base/jquery.ui.theme.css"/>"
type="text/css" />
<script type="text/javascript"
src="<s:url value="/js/jquery-1.9.1.min.js" />"></script>
<script type="text/javascript"
src="<s:url value="/js/jquery-ui.min.js" />"></script>
<script type="text/javascript"
src="<s:url value="/js/jquery.multiselect.min.js" />"></script>
<script type="text/javascript"
src="<s:url value="/js/jquery.multiselect.filter.js" />"></script>
<script language="javascript">
function selectionCube(cubeSelected) {
document.getElementById('cubeType').value = cubeSelected;
document.getElementById('exportFormStep1').submit();
}
</script>
<s:form id="exportFormStep1"
action="exportPdfValidationPerimeterReport.do" name="exportStep1Form"
theme="simple">
<s:hidden id="cubeType" name="%{cubeSelected}"></s:hidden>
<div class="contentTable">
<div class="bloc_action">
<input class="btn_action_right" type="button"
onclick="selectionCube('CUBE_1');"
value="Cube 1" />
<input class="btn_action_right" type="button"
onclick="selectionCube('CUBE_2');"
value="Cube 2" />
</div>
</div>
</s:form>