cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

WC 9.1 : How to set *cleanly* the default source on a primary attachment picker ?

Pierre-MariedeM
2-Guest

WC 9.1 : How to set *cleanly* the default source on a primary attachment picker ?

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

1 REPLY 1

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

Top Tags