You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "akshay.ramani" <ak...@yahoo.com> on 2010/06/29 20:46:40 UTC

Passing Value through Radio Buttons in struts

Hi, I have a bit of a problem and would appreciate some help!

I am creating a page that takes in a name and a text and runs an algo on the
text and then asks for user feedback.

I use radio Buttons to ask for the feedback (Positive or Negative)

Therein lies the catch.. I am not able to pass the value from the radio
button onto the bean and hence to the actionclass.

The code for the Part of the radio button is as follows:

According to you does the document express Positive or Negative sentiment?

<input type="radio" name="Senti" value="Pos"/>Positive <input type="radio"
name="Senti" value="Negative"/>Negative <html:submit value="Submit" />
</html:form>
I have defined a getter and setter method in my bean (using a string type)
But it does not seem to get the value as if I try and display it it displays
NULL.. <\p>

I would really appreciate some help Thanks in hope! <\p> 
-- 
View this message in context: http://old.nabble.com/Passing-Value-through-Radio-Buttons-in-struts-tp29027002p29027002.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Passing Value through Radio Buttons in struts

Posted by Paweł Wielgus <po...@gmail.com>.
Hi,
You can check if this parameter is present in request inside your action,
by implementing RequestAware,
but that just should work.

Best greetings,
Paweł Wielgus.


2010/6/29 akshay.ramani <ak...@yahoo.com>:
>
> Hi, I have a bit of a problem and would appreciate some help!
>
> I am creating a page that takes in a name and a text and runs an algo on the
> text and then asks for user feedback.
>
> I use radio Buttons to ask for the feedback (Positive or Negative)
>
> Therein lies the catch.. I am not able to pass the value from the radio
> button onto the bean and hence to the actionclass.
>
> The code for the Part of the radio button is as follows:
>
> According to you does the document express Positive or Negative sentiment?
>
> <input type="radio" name="Senti" value="Pos"/>Positive <input type="radio"
> name="Senti" value="Negative"/>Negative <html:submit value="Submit" />
> </html:form>
> I have defined a getter and setter method in my bean (using a string type)
> But it does not seem to get the value as if I try and display it it displays
> NULL.. <\p>
>
> I would really appreciate some help Thanks in hope! <\p>
> --
> View this message in context: http://old.nabble.com/Passing-Value-through-Radio-Buttons-in-struts-tp29027002p29027002.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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