You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Gupta, Sahil" <sa...@webmd.net> on 2004/07/20 17:40:48 UTC

Multiple Values In Form Hidden Parameter

Hi,

I'd like to pass multiple values in my form hidden parameter. Is there any
way i can do this?

<html:hidden property="svalues" value="abc,def"/>

Bean:

private String []svalues;

private String []getSvalues(){
return svalues;
}

private void setSvalues(String []vals){
svalues = vals;
}

TIA
S

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Multiple Values In Form Hidden Parameter

Posted by Rob McBride <ro...@gmail.com>.
Hi Sahil,

You can do this sort of thing by using indexed properties:

<html-el:hidden property="svalues[0]" value="abc"/>
<html-el:hidden property="svalues[1]" value="def"/>

But in your bean you will need to add getters and setters that include
the index as a parameter:

private void setSvalues(int index, String val)
{
    svalues[index] = val;
}

private String getSvalues(int index)
{
   return svalues[index];
}

HTH,
--Rob

On Tue, 20 Jul 2004 11:40:48 -0400, Gupta, Sahil <sa...@webmd.net> wrote:
> Hi,
> 
> I'd like to pass multiple values in my form hidden parameter. Is there any
> way i can do this?
> 
> <html:hidden property="svalues" value="abc,def"/>
> 
> Bean:
> 
> private String []svalues;
> 
> private String []getSvalues(){
> return svalues;
> }
> 
> private void setSvalues(String []vals){
> svalues = vals;
> }
> 
> TIA
> S
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org