Radio Buttons with add row functionality

Hi all, 

I want to put radio buttons  in which the options will be of an entity attribute.On selecting a particular radio button a text box will appear where we can fill the data for that particular attribute selected in radio button and after that..

i want to give a add row functionality clicking on which it will again show all the attributes as radio buttons except the one selected previously and so on.


Any idea how to go with this?

Hi. I would recommend you to look at this from a dropdown point of view (even though you are using a list of radio buttons). 

You will probably need to have an auxiliary table where you store the order in which your "text boxes" were added. Once you have that, you're going to need 2 aggregates in your preparation, 1 to display the information (if applicable), and, this is the important part, you'll need to do a LEFT JOIN between your main entity and your auxiliary one where the database id of your auxiliary table is null.

 This way, only the option that weren't selected will be displayed in your radio button list. 

Don't forget to create an auxiliary record and to refresh the query everytime you add a new row. 


Hope this helps you.

Gabriel Cardoso wrote:

Hi. I would recommend you to look at this from a dropdown point of view (even though you are using a list of radio buttons). 

You will probably need to have an auxiliary table where you store the order in which your "text boxes" were added. Once you have that, you're going to need 2 aggregates in your preparation, 1 to display the information (if applicable), and, this is the important part, you'll need to do a LEFT JOIN between your main entity and your auxiliary one where the database id of your auxiliary table is null.

 This way, only the option that weren't selected will be displayed in your radio button list. 

Don't forget to create an auxiliary record and to refresh the query everytime you add a new row. 


Hope this helps you.

Can't we add a condition for onchange for the radio buttons (i.e onchange it will show a textbox wih the value)?


Hello Subham,

Yes it is most likely to be possible to do what you want. And Gabriel already gave you some insight.

You need a dynamic list (list records) to show a variable number of radio buttons, associated with a list that you can filter out lines chosen. If it comes from aggregate or local list will depend on your details.

The Radio button can have an OnChange that will be called with ajax submit, so you can run an Screen Action with your logic to change a show condition (for an IF in the screen) eventually, update a variable and ajax refresh your page to show your option and the button you want to run your code to filter out the list and refresh it.

Everything basic, yet this interface seems rather bad UI/UX for me...

I would use a Combo Box / drop down with autocomplete instead.

Cheers

Yes, absolutely. You can use that as the add row trigger and do the necessary logic. If you think it fits your use case, you can hide the radio buttons on select and avoid to be playing with a list.