You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Chakradhar Tallam <c....@oopl.com.au> on 2002/05/06 05:33:32 UTC

variable number of text fields in a form

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.

Re: variable number of text fields in a form

Posted by Arron Bates <ar...@keyboardmonkey.com>.
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: 
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: variable number of text fields in a form

Posted by Arron Bates <ar...@keyboardmonkey.com>.
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: 
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: variable number of text fields in a form

Posted by Arron Bates <ar...@keyboardmonkey.com>.
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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>