This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

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

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Why am I so drawn to cherry pie? I can't seem to stop. Save me tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!