Quantcast
Channel: PTC Community : Discussion List - Windchill
Viewing all articles
Browse latest Browse all 5797

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

$
0
0

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.


Viewing all articles
Browse latest Browse all 5797

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>