Set color to new state in old web form tfs - tfs

I need to add new states to my project
I edit User Story.xml file and add the new states
But I don't know where I can set the color for the new states...
Here I add Awaiting customer state but it's without color:

Related

Generic dashboard state on Thingsboard

I have a entity admin table that navigates to a dashboard state for a specific row on row click.
I want to have a default dashboard state and on row click populate the dashboard with the data of the device. This needs to be repeated for multiple devices.
How would I go about doing this?
You need to set the state entity. In your row click action, if you are using a simple logic one, be sure to tick the "Set entity from widget" checkbox.
Then in the target dashboard state, you need to include an entity alias as below.
Text desc of image:
Alias Name: state entity
Filter Type: Entity from dashboard state
Resolve as multiple: False
Others: None (leave empty)
This will mean that all widgets using this alias will dynamically change based on the current "state entity". You can change the state entity multiple ways, but I recommend to minimise the places that you do this. It can get complicated fast.
If you are not using a simple widget action, and instead using a custom widget action, you will need to use the following code to set the state entity.
function updateDashboardState(stateId, label) {
var params = {
entityId: entityId,
entityName: entityName,
entityLabel: label, // Optional
};
// Line below opens new state
widgetContext.stateController.openState(stateId,
params, false);
// Line below updates state
// widgetContext.stateController.updateState(stateId,
params, false);
}

vaadin, allow new typed item in combobox

I've faced with the issue with Vaasin's Combobox. I'd like to allow the user be able as select existed item from the list same provide his own value typing in the text field. I thought that it has to be easy, but... What I have now is
ComboBox roles = new ComboBox();
roles.setInputPrompt("Select Role");
roles.addItems(userService.getAllRoles());
roles.setImmediate(true);
roles.setNullSelectionAllowed(false);
roles.setNewItemsAllowed(true);
formLayout.addComponent(roles);
Here I've found that setNewItemsAllowed allows such behavior, but for some reason it doesn't work for me. When I start typing some new value I can see an empty drop-down and when I select another field the value in checkbox reverts to prompt text.
It is not enough to allow new items in the ComboBox.
You must alos set the new item handler, until you do so, the ComboBox has no way to know what a new item should look like.
roles.setNewItemHandler(....your handler....);
Example code and the Docu for it.

Create Foreign Key Option for Dropdown and Return to Parent View in MVC

I apologize if this is a newb question. I'm more experienced with Windows forms and just getting started with MVC. I have a class called PackagedProduct which consists of a Package and a Product that are selected via drop down list and represented by their own models.
PackagedProduct
Sometimes though, the Product may not exist yet so I have an ActionLink that directs to the Create action of Product.
#Html.ActionLink("Create New Product", "Create", "Products");
Product
How can I allow the user to create the new Product, but when the create button is pressed to return to the PackagedProduct view where it originated with the existing data still populated(in this case UPCCode and Package)? The PackagedProduct won't have been created yet because it is missing required data until the correct Product is created so I can't just pass back the PackagedProductID. Thoughts?

Custom Gantt Chart view is not getting listed in standard view menu list

In my project I am using SharePoint Online and Provider hosted app for provisioning new sites. I was able to successfully provision a new task list in the newly provisioned site and a custom Gannt chart view associated with it.
But the newly created Gantt chart view is not getting listed in the standard view menu list. I can see the view if I access the list of views from the ribbon. Is this is a SharePoint related bug?
I found solution:
You need modify XsltListViewWebPart tool bar option from one value to another, and then back. That solves that bug in SharePoint.
public static void FixGanttIssue(SPList list, string ViewName)
{
SPSite site = list.ParentWeb.Site;
SPLimitedWebPartManager AllItemsMan = site.RootWeb.GetFile(list.Views[ViewName].Url).GetLimitedWebPartManager(System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared);
XsltListViewWebPart wp = (XsltListViewWebPart)AllItemsMan.WebParts[0];
wp.Toolbar = "Summary Toolbar";
AllItemsMan.SaveChanges(wp);
wp.Toolbar = "Full Toolbar";
AllItemsMan.SaveChanges(wp);
}

Why can't you add a EditorExit Handler to a DynamicForm or FormItem?

This handler only exist for a ListGrid.
But if you look at the docs for DynamicForm.setValidateOnExit(), it says:
If true, form items will be validated when each item's "editorExit"
handler is fired as well as when the entire form is submitted or
validated. Note that this property can also be set at the item
level to enable finer granularity validation in response to user
interaction - if true at either level, validation will occur on
editorExit.
So how can we add a EditorExitHandler to a DynamicForm or a FormItem?
EDIT :
I want to create an error panel below the form to show all errors dynamically. Each FormITem has the possibility to validate on Exit but I do not know how to capture this validation event to check if the error panel should be updated or not.
There is one method form.getErrors() and form.showError(true). By this you can acheive that. But for that also you need to setValidator for each field.
TextItem name = new TextItem("name", "Name");
name.setRequired(true);
name.setRequiredMessage("Please specify name of the Table");
NTRegExpValidator nameValidator = new NTRegExpValidator("(^[a-zA-Z0-9][\\w\\s.()_-]+)$","It should start with alphabets and can have alphanumeric values ( )_-. and space.");
name.setValidators(nameValidator);
name.addKeyUpFieldHandler(new KeyUpHandler){
form.getErrors();
form.showErrror(true);
});
DynamicForm form = new DynamicForm();
form.setField(name);
After some research, I still don't find a convincing answer. I guess it must a dev requirement

Resources