• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can i achevie Space Between Two Radio Buttons

 
S.Reddisekhar Reddy
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18108
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sriram Ganapathi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18108
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic