Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

select - what to put in property

 
AnilPrakash Raju
Ranch Hand
Posts: 137
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I was wondering what to put in the select - property field.

In my bean a got a vector which has a vector of strings.

eg. periodEndVec.add("period1");
periodEndVec.add("period2");
periodEndVec.add("period1");

then add to my bean - statBean.setPeriodEndVec(periodEndVec);

so in my jsp i got

<html:select property="???">
<html ptions name="statBean" property="periodEndingVec" />
</html:select>

But I don't know what to put in the select property?

Thanks

Anil
 
Shankar Narayana
Ranch Hand
Posts: 134
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anil,

You will get only the selected value from the dropdown when you submit the jsp page, and for that value you define a variable like "selectId" in your actionForm with the set/get methods and the corressponding property value will be "selectId".

Hope you got my point
 
AnilPrakash Raju
Ranch Hand
Posts: 137
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shankar,

I tried what you suggested, but i am getting an error

No getter method available for property periodEndingId for bean under name org.apache.struts.taglib.html.BEAN

Any other suggestions?

thanks

Anil
 
Shankar Narayana
Ranch Hand
Posts: 134
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anil,

I hope you have a variable named "periodEndingId" in your ActionForm and the corressponding methods might be


in your jsp you define the select tag as
<html:select property="periodEndingId" ...../>

check out the above things with your stuff, if everthing is as above with case sensitivity of the variables, then it shud work.

cheers..
 
AnilPrakash Raju
Ranch Hand
Posts: 137
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Shankar,

I had put the get and set methods in the wrong place.

thank you very much.

Anil
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic