Image a couple of objects for which one property can have 3 possible values. To edit them I want to use a radio button group with 3 buttons. If you have one object selected, it's obvious which radio button to select. But which what to select if multiple objects with different values of this property are selected? A radio button group without a selected radio button looks somewhat "naked".
One possible solution would be to add a 4th button to the group that indicates that the property is not set. You could have that one be the default when you need an 'indeterminate' default setting. This would allow the radio button group to start out with a selected radio button.
That being said, I'm having a hard time visualizing your situation. Do you think you could add some more detail to your question? I think you are talking about the default state of the radio buttons, but I'm not totally sure.
Hope this helps.
Related
I am trying to automate a booking process from an airline site.
In the second page of the booking process ('Select Flights'), there are multiple radio buttons which are very similar with other radio buttons available in the page. How can I select the radio button that I want to click?
I have already tried the xpath of the radio button but to no avail.
Here is the html code of the radio button:
Screenshot from booking.airasia.com
Please advise. Thank you
First element
Second Element
Well its true that you are getting similar elements for that given xpath but you also have to go through their siblings/parents etc for different scenarios.
Here is the xpath I tried that identified the individual elements that you were looking for, are depicted above.
//div[#class='iradio_square-green']/input[#id='trip_0_date_0_flight_0_fare_0']/following-sibling::ins
For others radio buttons you just have to change the flight number.
Hope this helps...
:)
I'm looking for a Qt/QML multiselect control that have a remove button.
I want to add a filter builder and I didn't find a good example or control for this purpose.
I can design token by myself. I'm just curious if someone already did that and can share it.
Multi filter selector
Thanks
A simple radio button for each option can do the job. If you do not include all these radio buttons under an exclusive group, a second click on these buttons deselects the option.
A click on the radio button includes selected option in the search results and second selection removes the option from the results.
An extra button which deselects all the radio buttons can also be added.
I don't intend to insult or disrespect you, but i think with radio buttons the task takes less time than posting this question.
I have some controls RadioButton,CheckBoxGroup and TextBoxes.I want to add these controls in this Dynamic Panel . And I have a Combo Box which have values 1,2,3,4,5,6. So when i select 1 from Combobox, 1 panel should display , when i select 2 from Combo box , 2 same panels should display an so on. Please help me anybody.
If you are referring to the Dynamic Forms module by DataSprings, you can create the intended behaviour by using "Question Events". You would first go into each "panel" you want to hide and click the "Hide question until forced visible by question event" checkbox. Then, go to the Question Events page and set up one event for each combobox value, with each one set to display the appropriate "panel". Several demonstrations are available here.
I have a radio button control with two items in it.
<xforms:select1 ref="add-delete" appearance="full">
<xforms:item>
<xforms:label>Add</xforms:label>
<xforms:value>A</xforms:value>
</xforms:item>
<xforms:item>
<xforms:label>Delete</xforms:label>
<xforms:value>D</xforms:value>
</xforms:item>
</xforms:select1>
I want to disable only the radio button 'Delete' and not the radio button 'Add' on condition X. How can I carry out this ?
I tried using class attribute with xforms:item but that is not working. Is there any other way to do this ?
Good question. And unfortunately, this isn't as easy to do as it should:
If you just wanted the delete radio button to be hidden, instead of disabled, you can replace the <xforms:item> for the "Delete" by an <xforms:itemset ref="…"> that you bind to a node which you make non-relevant when you want that radio button not to show. But you can't use that same technique to disable the radio button by binding the itemset to a node you make read-only. (And yes, it would be good if you could do that.)
As it stands, I think you'll need to:
Create 2 <xforms:select1>. One for "Add", one for "Delete", so you can make the second one readonly upon some condition.
To make it readonly, but not have the "Add" be read-only as well, you need to bind them to 2 separate node.
If you want to have 1 node with either A or D, you need to create a calculate to populate that node based on the 2 values.
You want the values to be exclusive, and they won't be if you have two <xforms:select1>, so you need to deselect "delete" when "add" is selected reacting to xforms-select, and vice versa.
In the model, you would have:
<xforms:instance>
<instance>
<add/>
<delete/>
<add-delete/>
<delete-enabled>true</delete-enabled>
</instance>
</xforms:instance>
<xforms:bind ref="add-delete" calculate="string-join((../add, ../delete), ' ')"/>
<xforms:bind ref="delete" readonly="../delete-enabled = 'false'"/>
And in the view:
<xforms:select1 ref="instance()/add" appearance="full">
<xforms:item>
<xforms:label>Add</xforms:label>
<xforms:value>A</xforms:value>
</xforms:item>
<xforms:setvalue ev:event="xforms-select" ref="instance()/delete"/>
</xforms:select1>
<xforms:select1 ref="instance()/delete" appearance="full">
<xforms:item>
<xforms:label>Delete</xforms:label>
<xforms:value>D</xforms:value>
</xforms:item>
<xforms:setvalue ev:event="xforms-select" ref="instance()/add"/>
</xforms:select1>
And see this Gist for the full source of this example.
I have added 8 radio buttons in my dialog layout in the resource manager, but I am having trouble separating them into 2 groups of 4 buttons. I have attempted to add a control variable, but I don't see the option of CButton available in the drop-down menu in the wizard. What would be the easiest method to accomplish this goal?
Make sure the first control in each group has the "Group" and "Tab Stop" attribute set.
Make sure that the control following the last radio button in each group has the "Group" attribute set.
Make sure that all the radio button IDs in each group are consecutive integers.
Create an integer member variable for each group
In the DoDataExchange method for the dialog add a DDX_Radio statement for each group linking the integer variable to the first ID in the group.
The integer variables will be set from the radio buttons whenever UpdateData(true) is called (called automatically by the default OnOk() handler) and the radio buttons can be set from the variables by calling UpdateData(false) (happens automatically in the default handling of OnInitDialog)
This problem is not a MFC problem, but a WIN32 radio button problem.
When creating the groups, the tab order (creation order) matters. You have to create them in order of the first group then the second group. The fist radio button control in each group has to have the "group" style selected.
You should be able to create the radio buttons in the Visual Studio dialog editor and run the Test Dialog and it radio groups should work ok within the two groups without any code at all. If they don't then you have done something wrong.
I found this using google which may help you.