Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hi,
I have to customize the default choice on the on the primary content source picker for a subtype of WTDocument creation wizard in PDMLink 9.1.
I have found two undocumented ways to do it :
One using undocumented tag attribute "defaultSource", this tag attribute is unfortunately not exposed in attachments.tld so I had to set it programmaticaly :
<%
com.ptc.windchill.enterprise.tags.attachments.PrimaryAttachmentsTag attachTag=new com.ptc.windchill.enterprise.tags.attachments.PrimaryAttachmentsTag();
attachTag.setJspContext(pageContext);
attachTag.setFixedFilePath("");
attachTag.setFixedFileUpload(false);
attachTag.setDefaultNameJSFunction("docSetName");
attachTag.setDefaultSource("NONE");
attachTag.doTag();
%>
On using contentTypeChanged JavaScript function but with the risk of addressing the bad picker, or not addressing anything at all (I have found the id "primary0contentSourceList" in the HTML generated source) :
<script>
var sourcePicker=document.getElementById("primary0contentSourceList");
var sourcePickerOptionNONE=document.getElementById("primary0contentSourceList_NONE");
sourcePickerOptionNONE.selected=true;
contentTypeChanged("primary0contentSourceList");
</script>
Is there a cleaner way to do this, like a windchill preference or something alike ?
Thanks in advance.
Solved! Go to Solution.
Hi Pierre,
There is the method setDefaultSource(String defaultSource) in the class PrimaryAttachmentsTag.
Although this is not implemented anywhere else, so it would seem that there is no preferences that would set this.
Thank you,
Jarrett
Hi Pierre,
There is the method setDefaultSource(String defaultSource) in the class PrimaryAttachmentsTag.
Although this is not implemented anywhere else, so it would seem that there is no preferences that would set this.
Thank you,
Jarrett