On Friday 13 August 2004 09:43, Brian Lee wrote: > Lists work, but you have to write your own set(int index) method to set the > correct object from the List. > > BAL
I still believe that lists work -- it's not lack of belief that's the problem, it's lack of results. There's some magic involved that, if documented anywhere is somewhere I have yet to uncover. Based on the general principal of orthogonality if the get method is properly invoked (which it apparently is) then the equivalent set method should also be invoked. That's simply not happening. However, orthogonality aside, if writing a separate indexed set method would make the problem go away I'd gladly use it. Alas, however, that doesn't make the slightest difference. I added two indexed set methods as you suggested with depressingly familiar results: package problem; import org.apache.log4j.Logger; import org.apache.struts.action.ActionForm; import java.util.ArrayList; import java.util.List; public class ProblemBean extends ActionForm { final private static int ENTRY_ROW_COUNT = 2; public ProblemBean() { log.info( "initializing entries" ); entries = new ArrayList(); // Create some entries for the form for (int ndx = 0 ; ndx < ENTRY_ROW_COUNT; ndx ++) { ProblemItem a = new ProblemItem(); a.setInteger_value( new Integer(ndx)); entries.add( a ); } } private String working_perfectly = "A Value"; public String getWorking_perfectly() { log.info( "getWorking_perfectly" ); return working_perfectly; } public void setWorking_perfectly( String working_perfectly ) { log.info( "setWorking_perfectly to '" + working_perfectly + "'"); this.working_perfectly = working_perfectly; } private List entries; public List getEntries() { log.info( "getEntries" ); return entries; } public void setEntries( List entries ) { log.info( "setEntries" ); this.entries = entries; } // Added an indexed setter "just in case" public void setInteger_value( int ndx, Integer iValue ) { log.info( "OHMYGOD -- IT GOT INVOKED!" ); ProblemItem pi = (ProblemItem)getEntries().get( ndx ); pi.setInteger_value( iValue ); } public static class ProblemItem extends ActionForm { // Used so that each item can have a unique value. private static Integer incrementing = new Integer( 0 ); public ProblemItem() { this.integer_value = incrementing; incrementing = new Integer( incrementing.intValue() + 1 ); } private Integer integer_value; public Integer getInteger_value() { log.info( "getInteger_value" ); return integer_value; } public void setInteger_value( Integer iValue ) { log.info( "setInteger_value to " + iValue ); this.integer_value = iValue; } // Added an indexed setter "just in case" public void setInteger_value( int ndx, Integer iValue ) { log.info( "OHMYGOD -- IT GOT INVOKED!"); this.integer_value = iValue; } private static Logger log = Logger.getLogger( ProblemItem.class ); } private static Logger log = Logger.getLogger( ProblemBean.class ); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]