0 Replies Latest reply on Sep 27, 2013 9:55 AM by user10351697

    How to trace jquery script in WCC

    user10351697

      Hi all,

       

      I want to create a component which can auto complete metadata input when checkin in WCC.

      For example, when i input metadata value 'An', then 'Ann','Anna' are displayed.

      So i use jquery autocomplete method. But it does not work well.

      So i need to trace jquery script.

      I set 'Oracle Diagnostic Logging level' as 'TRACE:32(FINEST)'in em, but i cannot find anything about my script in UCM_server1.log and UCM_server1-diagnostic.log.

      I also add '&IsPageDebug=1'to my url,and the 'JavaScript log'button is displayed, but after clicking the button, nothing is displayed.

       

      So can  you tell my how to trace jquery script in WCC ?

      By the way ,my jquery script is as following.

       

      --------------------------------------------------------------

      <script type="text/javascript" src="<$HttpWebRoot$>MetadataSuggestionList/jquery/jquery-1.6.2.min.js"></script>

      <script type="text/javascript" src="<$HttpWebRoot$>MetadataSuggestionList/jquery/jquery-ui-1.8.16.custom.min.js"></script>

      <script type="text/javascript" src="<$HttpCgiPath$>?IdcService=GET_DOC_PAGE&Action=GetTemplatePage&Page=SUGGESTION_LIST"></script>

      <link href="<$HttpWebRoot$>MetadataSuggestionList/jquery/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />

       

      <script>

          function monkeyPatchAutocomplete() {

                var oldFn = $.ui.autocomplete.prototype._renderItem;

               

                $.ui.autocomplete.prototype._renderItem = function (ul, item) {

                  item.label = item.label.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escapeRegex(this.term) + ")(?![^<>]*>)(?![^&;]+;)",

       

       

      "gi"), "<span style='font-weight:bolder;font-size:1.0em;'>$1</span>");

                  return $("<li></li>")

                          .data("item.autocomplete", item)

                          .append("<a>" + item.label + "</a>")

                          .appendTo(ul);

              };

          }

       

          <$if (#active.SuggestionListField like "")$>

              <$SuggestionListField="xEmployee"$>

          <$else$>

              <$SuggestionListField= #active.SuggestionListField$>

          <$endif$>

         

          <$if (isTrue(isQuery)) or (not isTrue(MultivalueOnCheckin))$>

          $(function() {               

                      monkeyPatchAutocomplete();

                      $( '[name="<$SuggestionListField$>"]' ).autocomplete({

                          source: availableTags

                      });

          });

          <$else$>

          $(function() {       

              monkeyPatchAutocomplete();

              function split( val ) {

                  return val.split( /,\s*/ );

              }

              function extractLast( term ) {

                  return split( term ).pop();

              }

             

              $( '[name="<$SuggestionListField$>"]' )           

                  .bind( "keydown", function( event ) {

                      if ( event.keyCode === $.ui.keyCode.TAB &&

                              $( this ).data( "autocomplete" ).menu.active ) {

                          event.preventDefault();

                      }

                  })

                  .autocomplete({

                      minLength: 0,

                      source: function( request, response ) {                  

                          response( $.ui.autocomplete.filter(

                              availableTags, extractLast( request.term ) ) );

                      },

                      focus: function() {

                         

                          return false;

                      },

                      select: function( event, ui ) {

                          var terms = split( this.value );                  

                          terms.pop();                   

                          terms.push( ui.item.value );                  

                          terms.push( "" );

                          this.value = terms.join( ", " );

                          return false;

                      }

                  });

         

          });

          <$endif$>

          </script>

      -----------------------------------------------------------------

      Thanks

       

      Qian