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 27, 2011, 5:32 PM
66 Posts

Re: Disable Click on Label(s) for Radio Buttons

  • Category: Other
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags:
  • Replies: 6
Hi Tommy,
 
I tried onmouseup and that is worse. It doesn't keep the value on either click of the label or click of the radio button after the partial update. Thanks for the suggestion though!
Apr 28, 2011, 12:25 PM
38 Posts
Re: Disable Click on Label(s) for Radio Buttons
The problem here is that XPage generates <label> tag around the radiobutton. For e.g. for the following XPage code snippet:
 
<xp:radioGroup id="radioGroup1">
<xp:selectItem itemLabel="value1" itemValue="value1"></xp:selectItem>
<xp:selectItem itemLabel="value2" itemValue="value2"></xp:selectItem>
<xp:selectItem itemLabel="value3" itemValue="value3"></xp:selectItem>
</xp:radioGroup> 
 
this HTML is generated: 
 
<table id="view:_id1:radioGroup1" class="xspRadioButton">
<tr><td><label><input type="radio" name="view:_id1:radioGroup1" value="value1">value1</input></label></td>
<td><label><input type="radio" name="view:_id1:radioGroup1" value="value2"> value2</input></label></td>
<td><label><input type="radio" name="view:_id1:radioGroup1" value="value3"> value3</input></label></td></tr>
</table> 
 
I simply could not find any property that would disable this <label> tag generation. So what I did was to create separate radiobuttons without labels and put them separately as plain text in XPage. Crude solution but it works! Something like this 
<xp:radio id="radio1" groupName="myRadioGroup"></xp:radio>Label1
<xp:radio id="radio2" groupName="myRadioGroup"></xp:radio>Label2 
 
Just make sure the groupName attribute is same for all radio buttons. 
 
Hope it helps!
Apr 28, 2011, 5:24 PM
66 Posts
Re: Disable Click on Label(s) for Radio Buttons
Naveen,
 
I tried your method. Unfortunately I can't get it to work with partial refreshes either. After selecting a radio button, the onclick (tried onmouseup also) event fires and does a partial update and the radio button loses its value. Were you able to get it to work after a partial update?

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