File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes How can i achevie Space Between Two Radio Buttons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "How can i achevie Space Between Two Radio Buttons" Watch "How can i achevie Space Between Two Radio Buttons" New topic
Author

How can i achevie Space Between Two Radio Buttons

S.Reddisekhar Reddy
Greenhorn

Joined: Jan 05, 2012
Posts: 29
Hi
This is my Code
I wrote Style in xhtml like:
</head>
<style type="text/css">
.myRadioCtrl span { padding-right: 20px; }
.myRadioClass td { width: 180px; }

</style>
<body>

And I am Using that Style class like:

<h:selectOneRadio id="countryDetails" enabledClass="black" styleClass="myRadioCtrl"
valueChangeListener="#{cc.attrs.showCounties}"
value="#{cc.attrs.countyIndicator}" label="" immediate="true"
required="true"
requiredMessage="#{cc.resourceBundleMap.requiredCounty}">
<f:selectItem itemValue="AllCountries"
itemLabel="#{cc.resourceBundleMap.labelAllCountries}" />
<f:selectItem itemValue="SelectedCounties"
itemLabel="#{cc.resourceBundleMap.labelSelectedCountries}" />
<f:ajax event="click" immediate="true"
render="pickListforCountries"></f:ajax>

</h:selectOneRadio>

and

<h:selectOneRadio id="reservationDetails" enabledClass="black" styleClass="myRadioClass"
value="#{cc.attrs.reservationIndicator}"
valueChangeListener="#{cc.attrs.showReservations}" label=""
required="true"
requiredMessage="#{cc.resourceBundleMap.requiredReseravation}"
immediate="true">
<f:selectItem itemValue="AllReservations"
itemLabel="#{cc.resourceBundleMap.labelAllReservations}" />
<f:selectItem itemValue="SelectedReservations"
itemLabel="#{cc.resourceBundleMap.labelSelectedReservations}" />
<f:ajax event="click" immediate="true"
render="pickListforReservations"></f:ajax>
</h:selectOneRadio>


But I didn't got the space between two RadioButtons
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16014
    
  20

Speaking of spacing, if you use the "Code" button on our message editor to wrap format tags around your xhtml, it will make things a lot more readable.

Also, it helps when giving examples to make them brief. The functional attributes that make up the bulk of your tags don't concern your problem, but they make it harder for us to see the problem.

As far as your layout issues go, I don't believe that this tag generates a span element, and if it does, I'm even less certain that you can set a padding on it. Your td style seems to have the wrong class name.


Customer surveys are for companies who didn't pay proper attention to begin with.
sriram Ganapathi
Greenhorn

Joined: Dec 19, 2012
Posts: 10
You can use the <p:spacer> to provide space between your radio butttons

like <hneRadio id="1"> <p:spacer height="0" width=""> <hneRadio id="2">

note : if you need both button on same line provide height as 0

please specify width according to your need


Regards,
Sriram.G
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16014
    
  20

sriram Ganapathi wrote:You can use the <p:spacer> to provide space between your radio butttons


Only if you are using PrimeFaces.

The p:spacer element is not part of the core JSF tag library set.

There is also the problem that the h:selectOneRadio renders all of the buttons from a single atomic element, so there is no place to insert a spacing element.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How can i achevie Space Between Two Radio Buttons