Skip to main content
1-Visitor
December 21, 2011
Question

Driving IBA Values

  • December 21, 2011
  • 3 replies
  • 3980 views

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.

3 replies

1-Visitor
December 21, 2011

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.

1-Visitor
December 22, 2011

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)

1-Visitor
June 7, 2013

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?

1-Visitor
June 5, 2013
12-Amethyst
June 7, 2013

The option is there but its not working as it should