Create radio button and define the action for the radio button

Having trouble installing Oxygen? Got a bug to report? Post it all here.
SmitaraniB
Posts: 3
Joined: Tue Nov 29, 2022 1:44 pm

Create radio button and define the action for the radio button

Post by SmitaraniB »

Hi Team,

How can I be able to create radio button and define the action for each of the radio button in java script file?

Thanks,
Smita
cristi_talau
Posts: 517
Joined: Thu Sep 04, 2014 4:22 pm

Re: Create radio button and define the action for the radio button

Post by cristi_talau »

Hello,

Out-of-the-box, Web Author offers some form controls that can be used to edit the value of an attribute. For example, oxy_popup displays a radio button that can be used to set the value of an attribute [1]. However, it does not perform a particular action when you select a value.
You have several options here:
  • Use oxy_popup and register an AuthorDocumentFilter using the Java API. The AuthorDocumentFilter can react to changes in the attribute value to perform your custom action
  • Use multiple oxy_button form controls to emulate the radio buttons. When pressing a button, change the element's attribute. You can use this attribute value in CSS to configure the appearance of the buttons
  • Implement a custom form control that does exactly what you want. [2]
Best,
Cristian

[1] https://www.oxygenxml.com/doc/versions/ ... ditor.html
[2] https://www.oxygenxml.com/maven/com/oxy ... ntrol.html
Post Reply