File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Calendar value not populating Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Calendar value not populating" Watch "Calendar value not populating" New topic

Calendar value not populating

yuva rani

Joined: Mar 17, 2008
Posts: 14
i have struts form 'genericForm', where in the text boxes and values are generated dynamically as shown in below code snippet. I wanted to display calendar icon against the DATE text boxes. So calling the calendar component. However the calendar value is not getting populated in text box
i think this is happening becos Textboxes are generated dynamically within the loop/iteration and unable to recognize textbox name.

Could you please suggest how to solve this issue.

<% int i=0; %>
<bean:define id="valChamps" name="genericForm" property="champs" />
<logic:iterate id="item" name="genericForm" property="metaAttributes">
<td class="Cnt1" ><bean:write name="item" property="name"/> </td>
<td><logic:notEqual value="DATE" name="item" property="typeComplet">
<input type="text" name="champs" value="<%=((String[])valChamps)[i]%>">
<logic:equal value="DATE" name="item" property="typeComplet">
<input type="text" readonly size="12" maxlength="10" name="champs" value="<%=((String[])valChamps)[i]%>">

<% i++; %>

please assist
yuva rani

Joined: Mar 17, 2008
Posts: 14
Including extra attribute "id" which generates unique name for each textbox solves the issue.
I agree. Here's the link:
subject: Calendar value not populating
It's not a secret anymore!