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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Blanking out default values in 10.1 for Classification Attributes

sdrzewiczewski
10-Marble

Blanking out default values in 10.1 for Classification Attributes

In 9.1 I was able to use AllClients.xml to remove the default values from Classification attributes so users would be required to fill in any Required attributes.



In 10.1 that's not supported anymore, and there is no OOTB solution until 10.2



I was able to come up with some Javascript that would remove the values from the form on load. There are two files that should be edited, one is for classifying a single part, the other is for classifying multiple parts.



  • codebase\netmarkets\jsp\part\C

  • codebase\netmarkets\jsp\part\setClassificationAttributesForMultiPartWizStep.jsp


Note in the code below I use the name of the element, instead of the id. For Multi-Valued attributes no id is included on the resulting HTML. Use this at your own risk and test it out. I tested this on IE 8, Firefox and Chrome and it worked for me.



For thesetClassificationAttributesForMultiPartWizStep.jsp file before the last line which is an <%@ include .. %> add this code





<script>

function clearDefaultValues(){

   var inputs = document.getElementsByTagName("input");

      for(var i = 0; i < inputs.length; i++) {

         if(inputs[i].name.indexOf('part$setClassificationAttributesWizStep$') == 0){

            inputs[i].value=";

         }

      }



   var selects = document.getElementsByTagName("select");

   for(var i = 0; i < selects.length; i++) {

      if(selects[i].name.indexOf('part$setClassificationAttributesWizStep$') == 0) {

         selects[i].selectedIndex =-1;

      }

   }

}

window.onload=clearDefaultValues();

</script>



For thesetClassificationAttributesForMultiPartWizStep.jsp file beflre the last line which is an<%@ include .. %> add this code




<script>


function clearDefaultValues(){


var inputs = document.getElementsByTagName("input");


for(var i = 0; i < inputs.length; i++) {


if(inputs[i].name.indexOf('part$setClassificationAttributesForMultiPartWizStep$') == 0) {


inputs[i].value=";


}


}


var selects = document.getElementsByTagName("select");


for(var i = 0; i < selects.length; i++) {


if(selects[i].name.indexOf('part$setClassificationAttributesForMultiPartWizStep$') == 0) {


selects[i].selectedIndex =-1;


}


}


}


window.onload=clearDefaultValues();


</script>


0 REPLIES 0
Announcements


Top Tags