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

Pulling my hair out over this one! Indexing issue

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
OK this is driving me crazy and I'm about to give up...

I'm trying very hard to use the "indexed='true'" feature of struts to manage a very simple ArrayList of objects in a page. It displays just fin, and I've checked the html code and it's populating the indexed properties just fine. But, when I post the form to an action, the constructor on the form gets called just fine but what I can NOT seem to get to happen correctly, is the part where Struts uses reflection to populated the list with the data on the html page. I just don't get why that part isn't happening... any ideas?

Config excerpt:

<action path="/VehicleDisplay"
type="packagename.presentation.action.vehicle.VehicleDisplayAction"
name="VehicleMaintenanceForm"
scope="request"
validate="false">
<forward name="success" path="vehicle.maintenanceThirdParty"/>
</action>

<action path="/SaveVehicleInfo"
type="packagename.presentation.action.vehicle.SaveVehicleInfoAction"
name="VehicleMaintenanceForm"
scope="request"
validate="true">
<forward name="success" path="vehicle.maintenanceThirdParty"/>
<forward name="stay" path="/SetupNewAccount.do"/>
<forward nam

Form:

public class VehicleMaintenanceForm extends ValidatorForm {

private List vehicleList;

public VehicleMaintenanceForm() {
vehicleList=new ArrayList(4);
for (int i=0; i<4; i++) {
vehicleList.add( new TagDTO());
}
}

public List getVehicleList() {
return vehicleList;
}

public void setVehicleList(List vehicleList) {
this.vehicleList = vehicleList;
}

}

Jsp excerpt:

<html:form action="/SaveVehicleInfo">

<logic:iterate name="VehicleMaintenanceForm" property="vehicleList" id="lineItem" indexId="rowNum">
<tr class="oddd">

<td align="center">
<html:text name="lineItem" indexed="true" property="licPlate"/>
</td>

</logic:iterate>

A breakpoint and trace thru the action "SaveVehicleInfo" confirms that the list is empty and was never populated by the framework...

Any ideas anyone?? What piece am I missing here? Thanks
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Mr Cranberry,

There are a couple of housekeeping issues I need to bring up with you.

The first is that it's considered bad form to post the same question in more than one thread as you have done. Please post the question to only one forum and one thread. Otherwise, it wastes the time of those willing to respond.

The second issue is the name you have displayed. The name you are currently displaying does not meet the guidelines of the JavaRanch Naming Policy. In particular, the name you display must be a first and last name, and must not be obviously fictitious. Please change the Publicly Displayed Name in your user profile so that it meets the guidelines.

This may seem trivial to you, but it's an important part of the culture at JavaRanch, and we do appreciate your compliance with it.

I'm closing this tread because it's a duplicate. Anyone wishing to respond, please do so in this thread.
[ July 18, 2007: Message edited by: Merrill Higginson ]
 
Uh oh, we're definitely being carded. Here, show him this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic