Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSF and the fly likes Message after SelectOneRadio moved to next line Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Message after SelectOneRadio moved to next line" Watch "Message after SelectOneRadio moved to next line" New topic
Author

Message after SelectOneRadio moved to next line

Bill Zelan
Ranch Hand

Joined: Jan 09, 2009
Posts: 46
We are experiencing the problem that a <h:message/> placed after a <h:selectOneRadio/> will always be placed on the next line, rather than one the same line (as with all the other components). In our design, all error messages are placed directly to the right of the corresponding field. The fact that radio buttons behave differently is somewhat confusing for our users. Consider the following example:


The selectOneRadio automatically creates a table, and in HTML anything that is placed after a table is automatically moved to a new line. I tried changing the style class "error" for the message by toying with the CSS options float and clear, but to no avail.

Does anyone have any idea how I can change this behaviour? Preferably, I am looking for a solution in CSS, where I can change the CSS properties of either the table (created by the selectOneRadio) or the message.
Jason Irwin
Ranch Hand

Joined: Jun 09, 2009
Posts: 327
I've not tried it, but could this work?


SCJP6
Bill Zelan
Ranch Hand

Joined: Jan 09, 2009
Posts: 46
Jason Irwin wrote:I've not tried it, but could this work?


Actually, that's the way the code works now. I have updated my code sample to reflect this.

The panelGrid translates into a table and within the TD of that table, the message is always below (and not aside) the selectOneRadio.
Bill Zelan
Ranch Hand

Joined: Jan 09, 2009
Posts: 46
We ultimately solved this by adding the CSS style "float: left;" to the selectOneRadio.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Message after SelectOneRadio moved to next line
 
Similar Threads
Simple question on SelectOneRadio
JSF SelectOneRadio and inputText
selectOneRadio - javascript get value
selectOneRadio problem
selectOneRadio in several columns...