This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to retrieve value from Radiobutton..It always returns null inspite of selecting .

 
shalu buchasia
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

getcolor alwauys returns null? Why? How should I retrieve value from a radio button..

 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
In jsp you have to read the value of the button by getParameter()method.then that value passes to the bean to set the color.
thanks.
 
shalu buchasia
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where should I call getparameter in my code.....
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have the right approach with:
public void setcolor(String tp)
{ color = tp;
}
public String getcolor()
{ return color;
}
BUT you are not observing the Bean naming rule, those methods should be
setColor( String x)
getColor( )
The variable name part of the method name must start with an upper case letter.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic