powerapps Radio button control - radio-button

I have a gallery and a radio button.
In the gallery where the user has to answer questions.
Each question can be a radio button with multiple choice answers, for example one could be a yes no response another could be a yes no unknown choice.
These choices are determined from the list field called answerchoice .
In the answerchoice field it might be populated with
yes\no or yes\no\unknown or 1\2\3\4.
Therefore in the items of the radio button I need to pass the values of the answerchoice field
Thank you

If the separator for the options is the \ character, then you can use the Split function to convert that into a collection that you can set to the Items property of the radio button control:
Split(ThisItem.Value, "\")

Related

How to find out which field a text box is linked to on a form? (Opposite direction of the ControlSource Property)

I have a form with multiple text boxes and want to select the one that is linked to a specific field in my dataset.
What I'm trying to do is basically the opposite direction of the ControlSource property... I know the field and want to find the associated text box.
E.g.: My dataset consists of the fields : Height, hair colour, weight, shoe size.
I have a form equipped with text boxes (for data entry) for each and every one of those fields.
I now want to select the text box linked to the field "weight"....
I could cycle through the controls on the form without a question, but is there a property of the text box telling me which field it's currently linked to?
I think I'm just too dumb to google it, but I just can't seem to find anything of the sort...
Thanks for your help in advance!
I could cycle through the controls on the form without a question, but
is there a property of the text box telling me which field it's
currently linked to?
Yes, that is - as you mention - property ControlSource …
So, loop the controls collection of the form (filter on control type TextBox) and find that (or those as it could be) bound to your field.

How may i increase the size of "Selection Options " of selection filed

i am creating a list of value by selection fields and giving values for user select by selection option property . but when i am doing for three or four item . it is going to good . but when i want to add more items in selection option then i am unable to do this task . selection option property is not giving me more space for adding new value.
so please any one give me solution so i'll add more values .
and other problem is that i've created a button in form . but i want that whenever any user press this button , a another fields should be display . and when again user will click on this button , a 3rd fields should be display.
i've created this 3 fields namely one,two,there.
syntax:-
if click "my" button , a another fields "two" should be display .
thank you
If you have more values in "Selection" field then you should create a class for those selection values and make your selection filed many2one. In your xml file make your field as selection using widget="selection"
For example:
class ur_class(osv.osv):
_columns = {'ur_field_name': fields.many2one('select.type', 'Select')}
ur_class()
class select_type(osv.osv):
_name = 'select.type'
_columns = {'name': fields.char('Type', size=50)}
select_type()
Now in ur xml use widget='selection' like this:
<field name="ur_field_name" widget="selection"/>
Now about your 2nd question to show fields from button click:
If you are changing state in button's method then you can use "attrs" attribute in your xml. You can find examples in addons.
Thank You,

Extjs4:Multiselect Option

In my form,i have a list of employees in a combo box and i need to map some employees to particular department.I need to change the combo-box to List box.Scenario is as follows,
1. List A contains all employees.
2. If i click 'Add' button the selected employees must move to list B
and list A must contain remaining employees
.
I searched for List box but i couldn't find in extjs4.
Is there any example or link for multiselect listbox in ext-js4?
Thanks
There is no built-in ListBox widget in ExtJs4. However, Ext.view.View may become an listbox after some manipulations.
Here is an example of such a tuned View. Demos may be found here, here and here (this one looks like just what you need).
You can create two such listboxes and the "add" button. Then assign handler to button which would remove selected item from the first listbox's store and add it to the second's store.

Get checked status of radio buttons in a Data Repeater

I have a Data Repeater in a Windows Form, within the data repeater I have a label and either a radio button or combo box, the amount of radio buttons and the text for them is brought in from my database as is the label and combo box.
The label is a question and the radio buttons or combo box allows the user to answer the question.
What I want to do is get the checked status of the radio buttons so I can then reveal the next question if it is needed. e.g. only show question 2 if question 1 is answered No.
'0 = Index in Repeater.
Dim bolChecked As Boolean = CType(rptYourRepeater.Items(0).FindControl("IdOfRadioButton"), RadioButton).Checked

Gray out a form row's (detail's) button conditionally with VBA code

I have a standard form in MS-Access which lists a bunch of orders, and each row contains order no, customer, etc fields + a button to view notes and attached document files.
On request from our customer we should gray out the button btnAnm (or check or uncheck a checkbox) depending on a calculation from two queries to two other tables (a SELECT COUNT WHERE and a check if a text field is empty).
I've tried btnAnm_BeforeUpdate(...) and btnAnm_BeforeRender(...) and put breakpoints in the subs, but none of them trigger. The same if I use the control Ordernr instead of btnAnm.
I'd like a function in the Detail VBA code to be triggered for each "Me." (row) so to speak, and set the row's control's properties in that sub.
What do I do? I've looked at the help file and searched here.
*Edit: So I want to do something that "isn't made to work that way"? Ie. events are not triggered in Details.
As an alternative, could I base the value of a checkbox on each line on a query based on the 'Ordernr' field of the current row and the result of a SELECT COUNT from another table and empty field check?
Do I do this in the query the list is based on, or can I bind the extra checkbox field to a query?
A description of how to do this (combine a COUNT and a WHERE "not empty" to yes/no checkbox value) would be perfectly acceptable, I think! :)*
You cannot do much with an unbound control in a continuous form, anything you do will only apply to the current record. You can use a bound control with a click event so that it acts like a button.
Presumably the related documents have a reference to the order number that appears on your form, which means that you can create a control, let us call it CountOrders, with a ControlSource like so:
=DCount("OrderID","QueryName","OrderID=" & [OrderID])
The control can be hidden, or you can set it up to return true or False for use with a textbox, you can also use it for Conditional Formatting, but sadly, not for command buttons.
Expression Is [CountOrders]>0
You can also hide the contents and add a click event so that is acts in place of the command button. Conditional Formatting will allow you to enable or disable a textbox.
As I understand your question, you have a continuous form with as command button that appears on each row - and you'd like to enable/disable the button conditionally depending on the contents of the row.
Unfortunately you can't do that. It seems that you can't reference the individual command buttons separately.
Having wanted to do something similar in the past I came up with two alternate ways of setting up my interface.
Put a trap into the onClick code for the Button. Which is icky, because it is counter intuitive to the user. But it gets you that functionality now.
Move the command button (and editable fields) up into the form header, and make the rows read only. Your users then interact with the record only in the header, and select the record they want work with in the list below. As I recall this is known a Master-Detail interface.