This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Problem with Hidden Tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with Hidden Tags" Watch "Problem with Hidden Tags" New topic
Author

Problem with Hidden Tags

Meenatchi Sundar
Greenhorn

Joined: Jan 31, 2011
Posts: 12
Hi,
This is Sundar.Actually im new to struts.I have an form named EmployeeExpenseDetails.jsp where i have an hidden tag like

<s:hidden name="desArrayHide" id="desArrayHide"></s:hidden>
<s:hidden name="amountArrayHide" id="amountArrayHide"></s:hidden>
<s:hidden name="noteArrayHide" id="noteArrayHide"></s:hidden>
<s:hidden name="expDateArrayHide" id="expDateArrayHide"></s:hidden>
<s:hidden name="expTypeArrayHide" id="expTypeArrayHide"></s:hidden>
<s:hidden name="proNameArrayHide" id="proNameArrayHide"></s:hidden>

In my action class,We get these hidden values by using request.getParameter("desArrayHide");My doubt is that how does that hidden tag is populated with the values...I paste my entire jsp page for reference to find it.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>

<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<head>
<title><s:text name="label.header.newexpensesclaim.name" /></title>
<sx:head cache="true"/>
</head>

<body>
<div class="textContent">
<div id="insertExp">
<jsp:include page="common/messages.jsp" flush="true"/>

<s:div cssClass="helpinformationmessage">
<s:text name="label.title.expenses.msg.info"/>
</s:div>

<s:form name="expenseForm">
<table class="maintable">
<tr>
<td align="center" ><table class="formouter">
<tr>
<td><table class="employeeformiinertable">
<tr>
<td class="formtitle">

</td>
</tr>
<tr>
<td class="forminner"><table class="tablealign">
<tr>
<td>
<s:hidden id="edit" name="editHidden"></s:hidden></td>
<s:hidden id="delete" name="deleteHidden"></s:hidden>
<td><s:hidden id="divEdit" name="divHidden"></s:hidden></td>
</tr>
<tr>
<td class="inputtextexpense" ><s:text name="label.header.expdetails.employeeName" />
<s:property value="#session.FIRST_NAME" /></td>

<td class="inputtextexpense"><s:text name="label.header.expdetails.requestDate"/>
<%Date currentDate=new Date();
SimpleDateFormat dateFormat=new SimpleDateFormat("dd/MM/yyyy");
dateFormat.format(currentDate);
out.println(dateFormat.format(currentDate));

%>
</td>


<td class="inputtextexpense">
<s:text name="label.header.expdetails.totalAmount" />
<s:textfield id="empExpenses.totalAmount" value="0.00" readonly="true" cssClass="employeeinput"/></td>
<s:hidden id="totalAmt" name="totalAmt"></s:hidden>
</tr>
</table>

<table id="details" class="borderAll" align="center">
<tr>
<td class="inputtext"><s:text name="label.form.fields.newexpenses.expensedate" /></td>
<td class="employeeinputtd">
<sx:datetimepicker id="empExpenses.expensesDate" displayFormat="MM/dd/yyyy" type="date" endDate="%{'today'}" cssClass="employeeinput"/> <s:text name="label.date.format"/>
</td>
<td class="inputtext" ><s:text name="label.form.fields.newexpenses.projectname" /></td>
<td class="employeeinputtd">
<s:select
headerKey=""
headerValue="-- Please Select --"
list="#application.APPL_PROJECT_LIST"
listKey="projectId"
listValue="projectName"
name="empExpenses.hcmoProjectId.projectId"
id="empExpenses.hcmoProjectId.projectId"
cssClass="employeeselect"
/>
</td>
</tr>
<tr rowspan="2" colspan="4">
<td class="inputtext"><s:text name="label.form.fields.newexpenses.expensetype" /></td>
<td class="employeeinputtd">
<s:select
headerKey=""
headerValue="-- Please Select --"
list="#application.APPL_EXPENSESTYPE_LIST"
listKey="hcmoExpensesTypeId"
listValue="name"
name="expenseDetails.hcmoExpensesTypeId.hcmoExpensesTypeId"
id="expenseDetails.hcmoExpensesTypeId.hcmoExpensesTypeId"
cssClass="employeeselect"
/>
</td>
<td class="inputtext"><s:text name="label.form.fields.newexpenses.amount" /></td>
<td class="employeeinputtd"><s:textfield id="expenseDetails.amount" name="empExpVO.amount" cssClass="employeeinput" onblur="amountValidation()"/></td>
</tr>
<tr>
<td class="inputtext"><s:text name="label.form.fields.newexpenses.note" /></td>
<td class="employeeinputtd"><s:textarea cssClass="employeetextarea" id="expenseDetails.note" /></td>
<td class="inputtext"><s:text name="label.form.fields.newexpenses.description" /></td>
<td class="employeeinputtd"><s:textarea cssClass="employeetextarea" id="expenseDetails.description" /></td>
</tr>
<tr></tr>
<tr align="left">
<td colspan="4" align="left"><div class="buttonblue"><s:a onclick="doInsert()"><span>Add Expense Detail</span></s:a></div></td>
</tr>

</table></td></tr></table></td></tr></table></td></tr></table>
<s:hidden name="desArrayHide" id="desArrayHide"></s:hidden>
<s:hidden name="amountArrayHide" id="amountArrayHide"></s:hidden>
<s:hidden name="noteArrayHide" id="noteArrayHide"></s:hidden>
<s:hidden name="expDateArrayHide" id="expDateArrayHide"></s:hidden>
<s:hidden name="expTypeArrayHide" id="expTypeArrayHide"></s:hidden>
<s:hidden name="proNameArrayHide" id="proNameArrayHide"></s:hidden>

<div id="test">

</div>
<table align="center">
<tr align="center">
<td >
<s:url id="insertEmployeeExpensesDetails" action="insertEmployeeExpensesDetails" />
<sx:submit id="submitAction" href="%{insertEmployeeExpensesDetails}" targets="insertExp" indicator="indicatorTabs" value="Submit" beforeNotifyTopics="/insertExpenses" disabled="true" cssClass="submitbutton117" ></sx:submit>
</td>
<td><s:reset key="button.label.reset" cssClass="resetbutton117" onclick="clearForm()" /></td>
</tr>
</table>

</s:form>
</div></div>
</body>

Aditi agarwal
Ranch Hand

Joined: Feb 23, 2011
Posts: 225
well i donot have much idea about it
but hope these 2 links can work for you


http://www.roseindia.net/struts/strutsHtmlTags.shtml



http://www.roseindia.net/struts/struts1/hidden-tag.shtml
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with Hidden Tags
 
Similar Threads
Problem's in display table
Struts 2
[Struts 2] How to populate select control after selection of a value in another select control
how to delete multiple browse
Null value is coming