Ok here goes :
The original method for the attribute recipients was :
        public void setRecipients(Vector input)

That caused the errors of the type mismatch ,
So I tried changing it to take to array of strings, like this
public void setRecipients(String [] one, String [] two)
It doesn't complain about anything, but it doesn't pass any values to it as I have tried putting in a few println statements in there.




Ian Hunter wrote:
I don't understand the question -- if your example is working, the setter
method is getting called and it's storing whatever got passed to it.  Can
you ask the question a different way?

----- Original Message -----
From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, February 26, 2003 12:25 AM
Subject: Re: Help with optionsCollection error



Another question Ian, since I changed it, what values would be passed
into the two inputs ? I tried doing a System.out.println to see what's
in there but apparently the output does not come out.

Ian Hunter wrote:

Lowly me? Contribute to the FAQ? hee hee. Glad to help.

(Hey, who's in charge of the FAQ around here?)

----- Original Message -----
From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 11:39 PM
Subject: Re: Help with optionsCollection error




Hi Ian, your tip worked like a charm and I substituted it with the
setRecipient(String key, String value) method. Hmm now I need to see
what exactly I put in there.....

Ian ever thought of adding this as a faq in Struts ?


Peng Tuck Kwok wrote:



Will try that and post results. Thanks.

Ian Hunter wrote:



I think so -- whichever setter method within your ActionForm applies
to the
field named in your <html:select> tag has to be the ONLY setter method
named
whatever it's named.

That's contradictory to normal bean conventions where you would

normally



have

public void setValues(Vector values)
and
public void setValues(String key, String value)

for instance.  The introspection done by Struts can't tell the
difference so
you get an error thrown by BeanUtils.populate where it tries to call
setValues(String key, String value) with only one value.

There has been a fair amount of debate about this recently, but if you
have
overloaded setter methods, comment all but the one that suits the type

of



value you're really using, and see if it works.

I had to go from having
public void setIds(String ids[])
and
public void setIds(int i; String ids[])

to having

public void setIds(String ids[])
and
public void setId(int i; String ids[])

see the difference? The "s" is gone in the case of the indexed

property.



See if that applies to your situation.

----- Original Message -----
From: "Peng Tuck Kwok" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 10:56 PM
Subject: Re: Help with optionsCollection error





I'm currently implementing the recipients as a vector of beans and I

do



provide method setRecipients which takes in a vector and sets the
recipients vector to it. Is that the setter method you are referring
to ?
Thanks.




Ian Hunter wrote:




The ActionForm descendant.



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




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





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





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




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





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




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





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



Reply via email to