locked
WHENCHANGE not working on webpage for 2 dependent dropdowns when using TFS 2017 - Visual Studio Client works fine. RRS feed

  • Question

  • Hi All,

    I am using TFS 2017 and VS2015 client

    I have a work item which contains 2 drop-down list objects... ( using a parent -  child dependency to populate the child list)

    So For example  - If the user picks an option in the parent then the child list is dynamically populated depending on which parent option is chosen. The user can then select an item from the child list.

    When I run this in VS 2015 it works fine.  User picks an item from the parent and then a item from the child list.  If then save it and then change their mind they can pick a different  item from the parent and an item from the associated child list.

    However when I do the above in the web view the child list is not getting dynamically populated with the correct items.

    I am using WHENCHANGED to detect when the parent item has bee changed but in the web page view the child list does not change - This works fine in the VS2015 client.

    Any ideas  for a workaround so that functio0ality is same in both VS and Web?


    Thanks


    • Edited by jscter Sunday, November 12, 2017 11:09 PM
    Sunday, November 12, 2017 11:08 PM

All replies

  • Hi jscter,

    Which update are you using with TFS 2017? Is it TFS 2017 Update 3?

    Which browser do you use? Do you try with other browser?

    Could you share your XML file for these two fields? I take a simple test on my side with TFS update 3, both VS and web portal work as expected. My XML file for the two fields are as below:

    <FieldDefinition name="parent" refname="test.parent" type="String">
      <SUGGESTEDVALUES expanditems="true" filteritems="excludegroups">
        <LISTITEM value="parent1" />
        <LISTITEM value="parent2" />
        <LISTITEM value="parent3" />
      </SUGGESTEDVALUES>
    </FieldDefinition>

    <FieldDefinition name="child" refname="test.child" type="String">
      <WHENCHANGED field="test.parent">
        <SUGGESTEDVALUES expanditems="true" filteritems="excludegroups">
          <LISTITEM value="child1" />
          <LISTITEM value="child2" />
        </SUGGESTEDVALUES>
      </WHENCHANGED>
    </FieldDefinition>

    Best regards,


    MSDN Community Support Please remember to click &amp;quot;Mark as Answer&amp;quot; the responses that resolved your issue, and to click &amp;quot;Unmark as Answer&amp;quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Monday, November 13, 2017 8:35 AM
  • Hi Can you try with the following lists

    Parent list  should contain  only  red, amber 

    When red is picked in the child list the options should be   car, van, bus

    When amber is picked in the child  list the options should be   mouse , cat, dog

    So for example if a user picks  RED then  van  and saves

    then they go back and pick  amber they should only be able to save on selection of  mouse or cat or dog

    but what i am seeing in the web is  they can still save with options Amber and van.. 

    in the VS client this is fine the wb representation isnt ... will forward on verison of  TFS etc

    Thanks

    Monday, November 13, 2017 9:23 AM
  • Hi jscter,

    According to your example, I recommend you using WHEN rule, instead of WHENCHANGED. Like this:

     <FIELD name="Parent" refname="test.parent" type="String">
            <ALLOWEDVALUES expanditems="true">
              <LISTITEM value="red" />
              <LISTITEM value="amber" />
            </ALLOWEDVALUES>
          </FIELD>
          <FIELD name="Child" refname="test.child" type="String">
            <WHEN field="test.parent" value="red">
              <ALLOWEDVALUES expanditems="true">
                <LISTITEM value="car" />
                <LISTITEM value="van" />
                <LISTITEM value="bus" />
              </ALLOWEDVALUES>
            </WHEN>
            <WHEN field="test.parent" value="amber">
              <ALLOWEDVALUES expanditems="true">
                <LISTITEM value="mouse" />
                <LISTITEM value="cat" />
                <LISTITEM value="dog" />
              </ALLOWEDVALUES>
            </WHEN>
          </FIELD>

    Please try this method.

    Best Regards


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Sunday, November 26, 2017 8:49 AM