microsoft / vsts-extension-multivalue-control

A work item form control which allows selection of multiple values.
MIT License
47 stars 45 forks source link

Can't get proper syntax #57

Closed aciccu closed 6 years ago

aciccu commented 6 years ago

I'm trying to implement this on a TFS 2018 Hosted XML project and I'm unable to reimport the WIT. The extension is installed in my project. When I export the WIT (custom WIT) from TFS 2018, I see the Extensions section with the multivalue control info in it and I'm able to add the Extension tag. But I'm having problems with the correct syntax for implementing it in the Control.

When I follow the instructions to insert the ControlContribution tag for the controls I want to have multivalues, I get errors on importing the WIT. Initially it was ' is unexpected token. Expecting white space.' It gives me a specific row and location, but there didn't seem to be any errors.

When I tried other methods of inserting the ControlContribution tag I would get an error that ControlContribution isn't valid for the Column section. I tried to make ControlContribution a child of the Control field, but that also threw an error.

Also there is no Type="" in the ControlContribution tag, is Type now unnecessary?

Thanks,

ostreifel commented 6 years ago

You need to place the <ControlContribution> within a <Group> like this image Detailed xml instructions can be found here

aciccu commented 6 years ago

So I put it in the same group as the Control is in? And I leave the Control line and tags all the same? Is the Type Field Control or Multivalue Control?

Except I got this error upon import. image

ostreifel commented 6 years ago

Make sure to use <WebLayout> not the old <Layout>

The path to the Group that you are placing the ControlContribution is /WITD/WORKITEMTYPE/FORM/WebLayout/Page/Section/Group

<ControlContribution Label="Label" Id="ms-devlabs.vsts-extensions-multivalue-control.multivalue-form-control">
    <Inputs>
        <Input Id="FieldName" Value="RefNameOfTheField" />
        <Input Id="Values" Value="ValueOne;ValueTwo;ValueThree;ValueFour" />
    </Inputs>
</ControlContribution>