It appears that it could be because you've nested "through" this property, and 
actually invoking something within your CallHistoryInfoItem returned at the given 
index.

If you're using a nested property (eg: "monkey.bunch[i].banana"), what it will do, is 
call all the getters down the line, and only call the setter on the last bean. For 
example, Struts will call the bean and use the getter method to get at the monkey bean 
(the "monkey" property). Then, it will call the indexed getter to get at the right 
bunch bean (the "bunch[i]" property). From this bunch bean, will call the setter on 
the banana property to set the value. So just keep in mind that the setter is only 
called on the last bean property.

I only say all this as it looks like your CallHistoryInfoItem is a bean in a nested 
structure, and the setter will be called later somewhere in the line.

Hope this gets you out of your problem.
If you want a little primer on nesting beans and such, try here...

        http://www.keyboardmonkey.com/next

If you have any further issues, you know where we are :)


Arron.




Chakradhar Tallam wrote:

>thanks Arron,
>
>here are my indexed getter/setter methods
>
>    public CallHistoryInfoItem getCallHistoryInfoItems(int index)
>    {
>        theLog.info("SetCallHistoryInfoForm.getCallHistoryInfoItems is
>getting executed");
>        return (CallHistoryInfoItem)
>((myCallHistoryInfoItems.toArray())[index]);
>    }
>
>    public void setCallHistoryInfoItems(int index, CallHistoryInfoItem chii)
>    {
>        theLog.info("SetCallHistoryInfoForm.setCallHistoryInfoItems is
>getting executed");
>        (myCallHistoryInfoItems.toArray())[index] = chii;
>    }
>
>getCallHistoryInfoItems is been called several times depending on the number
>of text fields on my form when the form is posted but
>setCallHistoryInfoItems never gets called.
>
>chaks.
>
>-----Original Message-----
>From: Arron Bates [mailto:[EMAIL PROTECTED]]
>Sent: Monday, 6 May 2002 2:57 PM
>To: Struts Developers List; Struts Users Mailing List
>Subject: Re: variable number of text fields in a form
>
>
>And this is a user-list type question, so I've forwarded there.
>
>Arron.
>
>Arron Bates wrote:
>
>>Depends on the type of indexed getter/setter you're using.
>>
>>public String getMyIndex(int i) {}
>>public void setMyIndex(int i, String value) {}
>>
>>...the setter will be called in this case, but in this instance...
>>
>>public Object[] getMyIndex() {}
>>public void setMyIndex(Object[] obj) {}
>>
>>...the setter will not be called, as the system will get the array, 
>>and set the item directly into the array, rather that return the 
>>resulting array back to the setter. This could very easily be the 
>>case. It's really easy to code this way, but don't expect the setter 
>>method itself to be called.
>>
>>Have you tried the nested tags?... makes light work of list type 
>>operations among everything else.
>>Anyways, I've ranted this before, and your answer "could" be above :)
>>
>>
>>Arron.
>>
>>
>>
>>Chakradhar Tallam wrote:
>>
>>>hi guys,
>>>
>>>how do i handle the setting of variable number of text fields in a form!
>>>i've tried with indexed properties but when i'm posting the form, the 
>>>get
>>>method is getting called rather than the set method for some reason. 
>>>have u
>>>had this kind of experience before, help is appreciated.
>>>
>>>thanks,
>>>CT.
>>>
>>
>>
>>-- 
>>To unsubscribe, e-mail: 
>><mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail: 
>><mailto:[EMAIL PROTECTED]>
>>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to