This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Calendar value not populating" Watch "Calendar value not populating" New topic
Author

Calendar value not populating

yuva rani
Greenhorn

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">
<tr>
<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:notEqual>
<logic:equal value="DATE" name="item" property="typeComplet">
<input type="text" readonly size="12" maxlength="10" name="champs" value="<%=((String[])valChamps)[i]%>">


</logic:equal>
</td>
</tr>
<% i++; %>
</logic:iterate>
==================

please assist
yuva rani
Greenhorn

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: http://aspose.com/file-tools
 
subject: Calendar value not populating
 
Similar Threads
populating a combo box
Struts 1.1: Need help with logic:iterate and logic:equals tag
how to apply continue statement in struts logic:iterate tag
text field validation
pass a variable in the URl