This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Apr 9, 2012, 10:42 AM
11 Posts
topic has been resolvedResolved

Suppress Fieldset with <xp:radioGroup> ?

  • Category: Styles and Themes
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 2
 
Does anyone know an easy way to suppress the fieldset that is rendered with a <xp:radioGroup> tag ?
 
As I am already grouping several controls into my own fieldset I don't want another fieldset appearing within my fieldset - it just doesn't look good.

I have replaced the radiogroup with a set of individual radiobuttons, but that presents a new problem - the defaultSelected attribute which should set the button by default doesn't appear to do anything. That makes it more difficult to validate that at least one of the radio buttons is selected when the form is submitted.
Is the issue with defaultSelected down to me or is this a bug with the core Xpages code ?
 
         <fieldset>
            ...
            other controls in my fieldset
            ...
            <xp:label value="Frequency" id="lFrequency"/>
            <xp:radio text="Weekly" id="rbWeek" defaultSelected="true" groupName="rgFrequency" style="position:absolute;left:8em">
                <xp:eventHandler event="onclick" submit="false" script="resetRadioButton (['#{id:rbFort}','#{id:rbMonth}','#{id:rbOther}'], '#{id:rbWeek}')" />
            </xp:radio>
            <xp:radio text="Fortnightly" id="rbFort" style="position:absolute;left:16em" groupName="rgFrequency">
                <xp:eventHandler event="onclick" submit="false" script="resetRadioButton (['#{id:rbWeek}','#{id:rbMonth}','#{id:rbOther}'], '#{id:rbFort}')"/>
            </xp:radio>
            <xp:radio text="Monthly" id="rbMonth" style="position:absolute;left:24em" groupName="rgFrequency">
                <xp:eventHandler event="onclick" submit="false" script="resetRadioButton (['#{id:rbWeek}','#{id:rbFort}','#{id:rbOther}'], '#{id:rbMonth}')"/>
            </xp:radio>
            <xp:radio text="Other" id="rbOther" style="position:absolute;left:32em" groupName="rgFrequency">
                <xp:eventHandler event="onclick" submit="false" script="resetRadioButton (['#{id:rbWeek}','#{id:rbFort}','#{id:rbMonth}'], '#{id:rbOther}')"/>
            </xp:radio>
        <fieldset>
 
Code for the event handler function -
function resetRadioButton (Group, Button) {
    if (dojo.byId(Button).checked) {
        for (var I = 0; I < Group.length; I++) {
            dojo.byId(Group[I]).checked = false
        }
    }
}
 
Apr 9, 2012, 1:11 PM
50 Posts
Re: Suppress Fieldset with <xp:radioGroup> ?
Have you tried using CSS to style the radio button group fieldset? Use .xspRadioButton class or use your own.
Apr 10, 2012, 7:56 AM
11 Posts
Re: Suppress Fieldset with <xp:radioGroup> ?
Doh!
 
That does the trick.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal