This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes need help with s:radio tag, display in a very strange way Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "need help with s:radio tag, display in a very strange way" Watch "need help with s:radio tag, display in a very strange way" New topic
Author

need help with s:radio tag, display in a very strange way

will zhang
Ranch Hand

Joined: Sep 11, 2008
Posts: 46
Hi, I'm using struts 2.1.6, I have my action code:

with getter and setter.

My jsp page:


However, my output is very weird:


every radio button and value occupied one line.

Anyone seen this before? Thanks!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'd check your CSS; IIRC the radio buttons would normally be on a single line--is that what you're expecting?
will zhang
Ranch Hand

Joined: Sep 11, 2008
Posts: 46
David Newton wrote:I'd check your CSS; IIRC the radio buttons would normally be on a single line--is that what you're expecting?


Yes, I expect the default single line. However, I don't have any special css for this page except button.

Is css the only reason which can cause this problem?

Here's my css:
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Does it work correctly if you create a test page w/ no CSS? How about a different browser?

There's no break tag in the radio template, which is why I suspect CSS.
will zhang
Ranch Hand

Joined: Sep 11, 2008
Posts: 46
David Newton wrote:Does it work correctly if you create a test page w/ no CSS? How about a different browser?

There's no break tag in the radio template, which is why I suspect CSS.


Hi Dave, I found if I don't use tiles, it works as expected(as default). But I need to use tiles, here is my layout.jsp for tiles.xml:
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Hmm, that doesn't make any sense to me either--I've used Tiles without seeing the weird rendering you're seeing (although I haven't used Tiles for awhile).

Have you tried inspecting the element in Firebug? That might give you a clue to the CSS that's causing the issue. You could also check the actual DOM in both the Tiles and non-Tiles rendering to see if it's different, possibly causing the difference. You could also tweak the Tiles definition to see if that makes a difference--it might just be that the table cell isn't wide enough and collapses, causing the radio buttons to be wrapped.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need help with s:radio tag, display in a very strange way