• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

indexed property

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

We're having a problem involving indexed properties in a form bean. This is the code of our form bean:


code:
--------------------------------------------------------------------------------

public class ManageRouteTemplatesForm extends ActionForm implements Serializable { /** * */private static final long serialVersionUID = 1L;private ArrayList<Dock> docks;private ArrayList<String> descriptionList;private ArrayList<RouteTemplate> routeTemplates;private String selectedDescription;private RouteTemplate selectedRouteTemplate;private RouteTemplate routeTemplateToInsert; /** * Code for the getters and setters */}

--------------------------------------------------------------------------------



As you can see, we have an arraylist called routeTemplates. That arraylist contains a collection of beans. Here it is the code of that bean:


code:
--------------------------------------------------------------------------------

public class RouteTemplate implements Serializable{ /** * */private static final long serialVersionUID = 1L;private String txtRoute;private String txtDescription;private String txtCompany;private String txtExpectedArrivalHour;private String txtExpectedExitHour;private String txtDestinationDocks;private String txtCommentsScheduleAnalyst;private ArrayList<RouteDockTemplate> rdtList; /** * + getters and setters */

--------------------------------------------------------------------------------



We are trying to set values in rdtList objects using the logic:iterate tag:


code:
--------------------------------------------------------------------------------

<logic:iterate name="manageRouteTemplatesForm" property="routeTemplates" id="routeTemplates"><tr><td><html:text indexed="true" name="routeTemplates" property="txtCompany" size="12%" /></td><td><bean:write name="routeTemplates" property="txtRoute" /></td><td><html:text indexed="true" name="routeTemplates" property="txtDestinationDocks" size="12%" /></td><td><html:text indexed="true" name="routeTemplates" property="txtExpectedArrivalHour" size="12%" /></td><td><html:text indexed="true" name="routeTemplates" property="txtExpectedExitHour" size="12%" /><html:text indexed="true" name="routeTemplates" property="txtExpectedExitHour" size="12%" /></td><bean : Define name="routeTemplates" property="txtRoute" id="nameRoute"/><logic:iterate name="routeTemplates" property="routeTemplates.rdtList" id="routeTemplates.rdtList"><logic:equal name="routeTemplates.rdtList" property="txtRoute" value="<%= nameRoute.toString() %>"><td><html:text indexed="true" name="routeTemplates.rdtList" property="txtDockArrivalHour" size="12%" /></td><td><html:text indexed="true" name="routeTemplates.rdtList" property="txtDockExitHour" size="12%" /></td></logic:equal></logic:iterate>

--------------------------------------------------------------------------------



We can see the values in our jsp but when we try to set a new value in the form bean, we are unsuccesful. The values remain as they were originally. We've been looking everywhere but we just don't know how get things working.

Can anyone give us a hand? Thanks in advance.
[ November 29, 2008: Message edited by: Bear Bibeault ]
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't read that code; please edit or re-post.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic