True/Fase Radio Buttons

  • 28 March 2016
  • 6 replies
  • 76 views

Badge +5

Hey yall.

 

Trying to create a form that has  Smartobjects with the option of selecting True or False radio buttons. 

 

Tried to play around with this and I created the SmartObjects as Yes/No but unsure how I can create the True/False option when this cant be set on the object?  (The radio buttons are in the list of controls).


6 replies

Userlevel 3
Badge +10

If I understand correctly, you're trying to set up a Radio Button List that displays 'True' and 'False', but saving to a SmartObject data type of 'YesNo'? Something like this:



 


If so, this can be achieved by adding some static values in the Data Source section of the Radio Button List control.


 


- Add two values 'true' and 'false' and provide matching Display names



 


The string values of 'true' or 'false' will correctly save to a 'YesNo' data and display in the SmartObject Tester as a checkbox:



 


If I have misunderstood your query, could you provide some more detail on what you're trying to achieve?


 


Hope this helps,


Jonathan

Userlevel 3
Badge +10

Alternatively, if you're looking to use a SmartObject as the Data Source, you can create a SmartObject with a 'YesNo' field and a 'Text' field for display.  This is useful if you required Display names other than 'True' or 'False':


 



 



 


Then add the follewing values via the SmartObject Tester:


ID: 1


YesNo: true


Display: Approved


 


ID: 2


YesNo: false


Display: Declined


 



 


Then set up the Data Source to use a Value of the 'YesNo' field, and a Display of 'Display':



 


This ensures the data saves as a 'YesNo' data type.

Badge +5

Hello Jonathan. 

 

Thanks for your inputs.  You understood what I am trying to do.  However, the issue I am having is actually changing the SMO field from a Yes/No to 'Radio', only selections I have are Autocomplete, Data Lable, Drop down list, lable, picker, and text box.

 

Userlevel 3
Badge +10

I'm not sure I understand what you mean.  Are you trying to convert an existing control on a form?  I recommend creating a brand new Radio Button List on a View and then tying it to a Data Source as mentioned above.

Badge +5

Jonathan.

 

Sorry for confusing you.

 

I was able to figure out how to create the true/false radio buttons for each smo by creating a grouping, etc.

 

So in another post I mentioned I created a basic form.  I also created a list view/form that I can go in and double click to open past submissions and the data will render into a readonly version of the form.  For some reason, the radio buttons do not return their original value.

Badge +3

If I understand what is going on here, you have a SMO with a YesNo data type.  You want to configure that for use with a radio button list, but you can't choose YesNo as the data type of the radio button list control, and you can't configure the field of the radio button list to the YesNo data type in the smart object.  Here is what I did to get around it.

  1. (Temporarily) change the smart object field data type to text.
  2. Configure your radio button list with "true" and "false" for a static list as Johnathan illustrated, and map it to your smart object field.
  3. Change the smart object field data type back to YesNo.
  4. Your radio button list control will now be YesNo data type, and will still be configured with your field that is now a YesNo data type.

Reply