• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts html tag question

 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
html:radio
 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34851
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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."
 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 156
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
put just
<html:text property="startDate"/>
check whether u have given correct getmethod getStartDate()
and setStartDate()
 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have given it correctly but still same problem
 
santhoshkumar samala
Ranch Hand
Posts: 156
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
does the formname here has to be the formbean name object or any name here for the form?
 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic