DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   JSP (http://www.daniweb.com/forums/forum24.html)
-   -   Disabling text-wrapping for f:selectItem tags (http://www.daniweb.com/forums/thread148842.html)

mowen85 Oct 3rd, 2008 2:28 am
Disabling text-wrapping for f:selectItem tags
 
The example code below produces two radio buttons, side by side, i.e.
O Keywords O All Fields

Without specifying a width for the selectOneRadio component (which I don't think is the best solution because of user controllable font sizes, etc), "All Fields" wraps across two lines to become:
O All
Fields
... which is a blight on my otherwise neat looking page.

In the code below, does anyone know how to force the space in "All Fields" to be non-breaking or how to style the selectOneRadio or selectItem's so that text-wrapping doesn't occur?

<h:selectOneRadio disabledClass="selectOneRadio_Disabled" enabledClass="selectOneRadio_Enabled" id="radio1" styleClass="selectOneRadio" value="{searchPageBean.searchCriteria.searchOption}" style="vertical-align: middle; margin: 0px; padding: 0px;">
        <f:selectItem itemValue="keywords" itemLabel="Keywords"/>
        <f:selectItem itemValue="all" itemLabel="All Fields"/>
</h:selectOneRadio>

I've tried, but without success:
- including "text-wrap: none;" and "white-space: nowrap" in the selectOneRadio's style attribute.
- wrapping the selectOneRadio &/or selectItem's in divs styled to have text-wrap set to none.
- replacing "All Fields" with "All&nbsp;Fields", but that just prints the latter.

I know it's a small issue, but any help would be appreciated. Thanks.


All times are GMT -4. The time now is 12:53 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC