| Author |
struts html tag question
|
Liz Brown
Ranch Hand
Joined: Oct 22, 2002
Posts: 112
|
|
<INPUT type=radio CHECKED value=radiobutton name=radiobutton1> I want to convert the above using html struts tags? How to include the checked in below? <html:radio property="nobackbill"/>
|
 |
Marc Peabody
pie sneak
Sheriff
Joined: Feb 05, 2003
Posts: 4727
|
|
|
html:radio
|
A good workman is known by his tools.
|
 |
Liz Brown
Ranch Hand
Joined: Oct 22, 2002
Posts: 112
|
|
so is it correct if i say: <html:radio value="on" property="getBill"/> to get a checked radio button. And where I don't need it checked, I will put the value="off" Am i right?
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26496
|
|
Liz, You are correct. Note that as written, the field in your form is "getBill". So you would have a getter called "getGetBill." I suspect, you want the radio button to be "bill" which maps to a getter called "getBill."
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Liz Brown
Ranch Hand
Joined: Oct 22, 2002
Posts: 112
|
|
thanks. i am facing another html tag problem. I give text field as: <html:text name="textfield" property="startDate"/> I have given get and set method in the form.however, i can't see anything. I get with plain html : <INPUT size=50 name=textfield> what may be wrong?
|
 |
santhoshkumar samala
Ranch Hand
Joined: Nov 12, 2003
Posts: 156
|
|
put just <html:text property="startDate"/> check whether u have given correct getmethod getStartDate() and setStartDate()
|
santhosh<br />SCJP,SCWCD
|
 |
Liz Brown
Ranch Hand
Joined: Oct 22, 2002
Posts: 112
|
|
|
I have given it correctly but still same problem
|
 |
santhoshkumar samala
Ranch Hand
Joined: Nov 12, 2003
Posts: 156
|
|
go through following steps 1)check whether you have declared html taglib in your jsp i.e, <%@ taglib uri="ur tag lib location" prefix="html" %> 2)check whether ur giving correct form name in struts-config.xml 3)check whether the action in jsp <html:form action=""> is referring to correct path in struts config. If everything is correct and still u face problem, please post ur jsp and struts-config and actionform
|
 |
Liz Brown
Ranch Hand
Joined: Oct 22, 2002
Posts: 112
|
|
|
does the formname here has to be the formbean name object or any name here for the form?
|
 |
Liz Brown
Ranch Hand
Joined: Oct 22, 2002
Posts: 112
|
|
thanks! got it .i was not using the <html:form> How to get a checked checkbox? <html:checkbox property="imported"> gives only a checkbox, but if i had to show user default which is checked, how to?
|
 |
 |
|
|
subject: struts html tag question
|
|
|