This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSF and the fly likes Message after SelectOneRadio moved to next line Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply 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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Message after SelectOneRadio moved to next line
 
Similar Threads
selectOneRadio - javascript get value
selectOneRadio in several columns...
Simple question on SelectOneRadio
selectOneRadio problem
JSF SelectOneRadio and inputText