Community Tip - You can change your system assigned username to something more personal in your community settings. X
In Windchill 10 we have a requirement to list down the applicable values in pull downlist for "IBA 2" based on "IBA 1" value. This is required while create WTDocument/WTPart from html page as mentioned below.
Example :
If "IBA 1" has value as "Country", "IBA 2" pull down should list "India, US, UK".
If "IBA 1" has value as "City", "IBA 2" pull down should list "Bangalore, New Delhi, Mumbai".
Can we achieve this by defining constraints or we need to do little bit of customization. If anyone has a solution, please let me know.
I haven't played with 10 so I can't speak for that and I've heard the ui is very different.
Coming form a 9.1 perspective, there are no conditional constraints to pull this off. I would probably hijack one of PTC's js files. View the generated dom for your create form.
Assuming your type is: WCTYPE|wt.doc.WTDocument|com.something.SomethingDocument
Assuming your attribute is: testString
You would find a form field with ID: WCTYPE|wt.doc.WTDocument|com.something.SomethingDocument|testString
I don't know if you need to grab an existing action listener or just add an onchange but that should be a good starting point.
Matt's answer seems like it might be a more solid way to do this.
I tested out in 10.0 and it works fine for my IBA's with IBA2 being empty.
This wont work if your IBA has values to start because this overrides them.
Just an idea to get you started
setTimeout(function(){
var opt = document.getElementById("IBA2");
var e=document.getElementById("IBA1")
e.onchange=function(){
if( e.options[e.selectedIndex].text=="Clerical Change"){
opt.options.length=0;
opt.options[0]=new Option("US", "US", true, false);
opt.options[1]=new Option("Inda", "Inda", false, false);
opt.options[2]=new Option("UK", "UK", true, false);
}else if( e.options[e.selectedIndex].text=="Corrective Action"){
opt.options.length=0;
opt.options[0]=new Option("Bangalore", "Bangalore", true, false);
opt.options[1]=new Option(" New Delhi", " New Delhi", false, false);
opt.options[2]=new Option("Mumbai", "Mumbai", true, false);
}
}
},1000)
Where can i write the above function that you have mentioned. Can you please elaborate on where this function should be written, and will it require any other entries to be done?
Did anyone tried out the Attribute Constraint Conditions?
https://firstrobotics.ptc.com/Windchill-WHC/index.jspx?id=TypeMgrAttrInfoConstraintsTab&action=show
The option is there but its not working as it should
The OOTB attribute constraint does not work if you are having legal value set, it does not give a drop down on the front end. Also in the constraint we can only provide the "if" part, we cannot do any changes for the "then"part. So it is not of any great use.
Configuration for:
CategoryA results in SubCategory1, SubCategory2 & SubCategory3
CategoryB results in SubCategory4, SubCategory5 & SubCategory6
CategoryC results in SubCategory7 & SubCategory8
should be like this:
Category:
Single-Valued
Enumerated Value List (CategoryA, CategoryB & CategoryC)
SubCategory:
Single-Valued,
Enumerated Value List (SubCategory1, SubCategory2 & SubCategory3 with condition Category, Legal Value List = CategoryA),
Enumerated Value List (SubCategory4, SubCategory5 & SubCategory6 with condition Category, Legal Value List = CategoryB)
Enumerated Value List (SubCategory7 & SubCategory8 with condition Category, Legal Value List = CategoryC).
But UI of Windchil 10.1 M030 doesn't support this. Does anyone has M040 installed?