Struts radio initial values
From: Cindy Lee (dangreece_at_hotmail.com)
Date: 04/27/04
- Next message: Murat Tasan: "0.0d == 0.0d + Double.MIN_VALUE returns true"
- Previous message: Niklas Borson: "Re: Cracking DES with C++ is faster than Java?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 27 Apr 2004 19:16:55 GMT
I'm having problems setting my initial values. I can't change the selected
radio box value, even though I set it. It always stays at the inital value.
I can't preset it to Beta. Code parts below.
jsp file::
<%
MyActionForm mform= new MyActionForm ();
mform.setSelectedOption("Beta");
%>
<html:radio property="selectedOption" value="Alpha">Alpha</html:radio>
<html:radio property="selectedOption" value="Beta">Beta</html:radio>
<html:radio property="selectedOption" value="Charlie">Charlie</html:radio>
<html:radio property="selectedOption" value="Delta">Delta</html:radio>
The Struts ActionForm class:
public class MyActionForm extends ActionForm
{
private String selectedOption;
public MyActionForm()
{
setSelectedOption("Alpha");
}
public void reset(ActionMapping mapping, HttpServletRequest request)
{
setSelectedOption("Alpha");
}
public String getSelectedOption()
{
return this.selectedOption;
}
public void setSelectedOption(String selectedOption)
{
this.selectedOption = selectedOption;
}
}
- Next message: Murat Tasan: "0.0d == 0.0d + Double.MIN_VALUE returns true"
- Previous message: Niklas Borson: "Re: Cracking DES with C++ is faster than Java?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]