• Post Reply Bookmark Topic Watch Topic
  • New Topic

2-dimentional array  RSS feed

 
Konstantin Chikarev
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, people!
I have several select elements with multiple choise enabled. I need to create ActionForm that can get the 2-dimentional array (or a collection of collection) of selected values. Here is the sample code of my jsp:



<%= "permtype[" + index + "]"%> is the property where I have problem. I don't know how to declare it in ActionForm.
[ February 19, 2005: Message edited by: Konstantin Chikarev ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Konstantin,

In this case, you would code the <html:select> tag as follows:



Check out the documentation for more details on how the indexed property works.

http://struts.apache.org/userGuide/struts-html.html#select

Merrill
 
Konstantin Chikarev
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, I find the way to solve the problem myself. I use struts 1.2 so I don't need old usage of indexed property

equals
 
sheida sadrai
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi konstantin,
I have the same issue. I want to know how you solved it.
I have a iteration over a multiple select.
how can I get the values in my form? what should i have in my action form? String[][] or what?
 
Konstantin Chikarev
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check email.
 
mohamed zafer
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi There,

My html source looks like this

<select name="screen[2].question[0].answer" multiple>
<option value="01">A1</option>
<option value="02">A2</option>
<option value="03">A3</option>
</select>

The screen , question and answer are array objects, but the selected values do not get populated in the answer array object, and I get

java.lang.IllegalArgumentException: argument type mismatch

I have the requisite getter setter methods. Any idea how to solve this

Regards
Zafer
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!