lokesh kumarputta wrote:
But my requirement is some thing different .
I have one arrayList and it conatins one DTO object , I am doing iteration on that arrayList and i have to display the radio button.. using <html:radio >...
1. A boolean is better represented by a checkbox (checked = true, unchecked = false). You can have a radio button group with two radio buttons for (Yes/No, True/False, Go/No go, Accept/Decline, etc...) but why take up more space than you need to?
2. Since you use the logic:iterate tag, it looks like you're using
Struts, correct? Then read up on the Struts bean tags that render either checkboxes or radio buttons
3. One arraylist that contains one DTO is a very bad design that I have seen many times and I can't for the life of me understand why it comes up as often as it does in code. In Struts,
you should just use an ActionForm (Struts1) or an extension of ActionSupport (Struts2). Do you have
only one DTO? If so, then why are you putting it into an ArrayList? And why ArrayList specifically instead of a List (you should always prefer to program to interfaces, not concrete implementations).
4. The Struts Tags documentation should have some examples of how your rendered checkbox or radio buttons can have a preselected state based on the values in a bean.