We have a number of wtDocuments that require "No Content" & others that require a template to be selected. Our users continually make the mistake of not selecting the template, and complain why we can't make "No Content" as a default for documents.
Solved! Go to Solution.
Looks like I was able to do this by modifying the documentManagement.js file.
Hello Tim,
I believe I have done this before. Let me go through my archived emails and I will share steps with you.
Thanks,
Shirish
Hi Tim,
Wanted to confirm which Windchill release & datecode you are using so I can validate the steps for this perticular release.
Additionally are you also looking for a way to hide "Local File" option from drop down list?
Best Regards,
Shirish
Looks like I was able to do this by modifying the documentManagement.js file.
Hi Tim,
You can also achieve this using JavaScript. For an example, you can below JavaScript function in "<WT_HOME>\codebase\netmarkets\jsp\document\create.jspf":
<script language="JavaScript">
PTC.driverAttributes.on("afterRefresh",function() {
setTimeout(function(){ customPrimaryContent(); }, 100);
});
function customPrimaryContent(){
var element = document.getElementById("createType").value;
var desiredDoc = "wt.doc.WTDocument";
var list = document.getElementsByName('___primary0contentSourceList___combobox');
var fileInput = document.getElementById("primaryFileWidgets");
if(element.toLowerCase() === desiredDoc.toLowerCase()) {
list[0].selectedIndex = 0;
fileInput.style.display = "none";
} else {
list[0].selectedIndex = 1;
fileInput.style.display = "initial";
}
}
</script>
By doing this I am able to make "No Content" to Document type. See below:
Thanks,
Shirish