Don't know how to set a Boolean workitem field in Azure DevOps Server to display Yes/No instead of True/False - azure-devops

I'm running Azure DevOps Server 2019 and I added a Boolean field to my User Story work item. The description for Boolean fields says "Boolean: Adds a True/False or Yes/No field.". It defaults to displaying a True/False toggle. I can't find how to change it to display a Yes/No toggle instead.

Sorry for confusion. The value "Yes/No" is actually not supported for a Boolean field type by default. An a workaround, you can use String type instead of Boolean type, which render a dropdown box for Yes/No:
<FieldDefinition name="MyField" refname="My.Field" type="String">
<ALLOWEDVALUES expanditems="true">
<LISTITEM value="Yes" />
<LISTITEM value="No" />
</ALLOWEDVALUES>
</FieldDefinition>

Related

How to add pre-defined values on "Found in Environment" field

AzureDevOps has a a filed called "Found In Environment".
I want to add this to my work items, however I would like to setup a predefined list of values that the user should select.
I can do this by adding a new custom filed, but It would be strange to add custom filed for a filed that AzureDevOps already have.
Question: Is there any way to configure a predefined set of values for already existing filed?
Actually, Azure DevOps just support users to customize the values for any system picklist(except the reason field) such as Severity, Activity, Priority, etc. You can refer to here to get the information about customize system picklist values.
As my test, the Found in Environment field only support one default value, not picklist items.
So according to your question, some fileds can configure set of values for already existing field, but not the Found in Environment field.
Or you can use XML to customize your own process and fields value by your rule. Below is a simple sample about how to definition a work item picklist items in XML.
In addition, only after Migrate from tfs to azure devops, you will have edit xml options. About XML, you can refer to here
<FIELD name="Priority" refname="Microsoft.VSTS.Common.Priority" type="Integer" reportable="dimension">
<HELPTEXT>Business importance. 1=must fix; 4=unimportant.</HELPTEXT>
<ALLOWEDVALUES expanditems="true">
<LISTITEM value="1" />
<LISTITEM value="2" />
<LISTITEM value="3" />
<LISTITEM value="4" />
</ALLOWEDVALUES>
<DEFAULT from="value" value="2" />
</FIELD>

Data binding of lightning:input and aura:attribute with type sObject(field) is not working

There is a weird scenario I'm facing while I try to bind the markup UI tags with lighting aura:attribute as type sObject (fields).
I'm trying to bind data to sobject's fields for different lightning:input tags,
For one sObject attribute the binding works perfect, but in the same way for another sObject the data is not getting bound.
For Ex:
<aura:attribute name="student" type="JN_Student__c" access="global" default="{'sobjectType' : 'JN_Student__c'}" />
<lightning:input aura:id="requiredVal" name="lastName" label="Legal Last Name"value="{!v.student.JN_Last_Name__c}" maxlength="20" required="true"/>
this works perfectly and the data persists as I show/hide this section.
WHEREAS for,
<aura:attribute name="insuranceInstance" type="JN_Insurance__c" access="global" default="{'sobjectType' : 'JN_Insurance__c'}" />
<lightning:input aura:id="requiredVal" name="lastName" label="Legal Last Name" value="{!v.insuranceInstance.Name}" maxlength="20" required="true"/>
the 'v.insuranceInstance.Name' doesn't persists its value.
Please reply if anyone knows/encounted the same.

Binding SelectedItem to IsChecked

I have listBox modified for check boxes. I would like to bind the selectedItem to the check so that I can use $WPFlbSiteList.SelectedItem as the basis of selecting items that are checked.
Basically, I have generated a list I need the checks to equate to the selected item. This selected item also needs to work in a multi selection capacity rather than one at a time.
<ListBox x:Name="lbSiteList" SelectionMode="MultiExtended" Margin="355,45,411,1014" ItemsSource="{Binding .}">
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox Content="{Binding .}" IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}, Path=IsSelected}" Margin="2,2,0,0"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
My function to write to the console which of my checked items are selected.
$WPFbtnUpdate.Add_Click({
#List the sites that are ticked
foreach ($WPFlbSiteList.Items in $WPFlbSiteList){
$x=$WPFlbSiteList.SelectedItems
write-host $x
}
})
As noted in the comments you can bind the checkbox IsChecked value to IsSelected of it's relative ancestor (the listbox) with:
<CheckBox IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}, Path=IsSelected" />
Your real issue, however, seems to be that you're using an invalid value for the ListBox' SelectionMode property.
In WPF, the valid selection modes are:
Extended - The user can select multiple consecutive items while holding down the SHIFT key.
Multiple - The user can select multiple items without holding down a modifier key.
Single - The user can select only one item at a time.

Ignore custom validation, but not the required="true" depending on button pressed

I am using JSF and I want to validate a form.
In the form is a text field that is validated by required="true" and a validator method.
<h:inputText
required="true" requiredMessage="Please enter a topic"
validator="#{eventController.validateTopic}" />
To submit the form I have two buttons. When clicking on the first, it should be only validate if the field is empty. By the second one the custom validation should be additionally invoked.
Is this possible?
First turn that validation method into a true Validator implementation.
#FacesValidator("topicValidator")
public TopicValidator implements Validator {}
Then you can use it in a <f:validator> which supports disabled attribute.
<h:inputText ...>
<f:validator validatorId="topicValidator" disabled="..." />
</h:inputText>
To let it check if a certain button is pressed, just check the presence of its client ID in the request parameter map.
<h:inputText ...>
<f:validator validatorId="topicValidator" disabled="#{empty param[secondButton.clientId]}" />
</h:inputText>
...
<h:commandButton binding="#{secondButton}" ... />
Note: do absolutely not bind it to a bean property! The above code is as-is. You should only guarantee that the EL variable #{secondButton} is unique in the current view and not shared by another component or even a managed bean.
See also:
How to let validation depend on the pressed button?
How does the 'binding' attribute work in JSF? When and how should it be used?

value for select in Selenium IDE

Is there a way to select an item based on the label containing a set of characters? I can't select by index as that will change, and the items being generated in the select have some random numbers appended at the end. I'd like the basically say if the label contains "this."
is that possible?
Thanks!
Sure, example in XPath:
//*[contains(text(), 'this')]
Or CSS:
select:contains('This')
Another example
<label for="blah">
<input name="blah" id="blah" type="checkbox" />
Store Locator Plus
</label>
My target to get the checkbox:
//label[contains(text(),'Store Locator Plus')]//input[#type="checkbox"]
To check it I use the command "check", the target noted above, and a value of "On", which forces the checkbox to be marked (versus using click which will toggle it on/off).