Enter Key on home page search IP-2013

This article has been contributed by Gururaj Basavaraj a reader of Siebel Unleashed.


If you are in IP2013 you might be having problem search on home page by pressing enter key instead of

Go click. For that below is the PR code, associate this to all home page search applets.

if(typeof(SiebelAppFacade.EnterKeySearch) === "undefined"){
       SiebelJS.Namespace("SiebelAppFacade.EnterKeySearch");
       define("siebel/custom/EnterKeySearch", ["siebel/phyrenderer"], function(){
          SiebelAppFacade.EnterKeySearch = (function(){
          function EnterKeySearch(pm){
             SiebelAppFacade.EnterKeySearch.superclass.constructor.call(this,pm);
          }
       SiebelJS.Extend(EnterKeySearch, SiebelAppFacade.PhysicalRenderer);
       EnterKeySearch.prototype.BindEvents = function(){
           SiebelAppFacade.EnterKeySearch.superclass.BindEvents.call(this);
           Search.call(this);
      };
 
     function Search() {
         var oPM = this.GetPM();
         var sAppletId = "#S_A"+oPM.Get("GetId");
         $(sAppletId).delegate("input","keydown",function(){
         });
     }
  return EnterKeySearch;
}());
return "SiebelAppFacade.EnterKeySearch";
});
}

This Post has been viewed : 5,869 Times


2 Responses to Enter Key on home page search IP-2013

  1. Hi,
    Did anyone try this code? I found it not working, sorry.
    With some changes, I was able to capture the ‘EnterKey code’. However, on click on Enter (#13) I was trying to execute vanilla method ‘Mirror Search GotoView’ (the method behind ‘GO’ button), which didn’t work.
    Can you assist me whats wrong with the below code:

    if(typeof(SiebelAppFacade.SKTLEnterKeySearch) === “undefined”){
    SiebelJS.Namespace(“SiebelAppFacade.SKTLEnterKeySearch”);
    define(“siebel/custom/SKTLEnterKeySearch”, [“siebel/phyrenderer”], function(){
    SiebelAppFacade.SKTLEnterKeySearch = (function(){
    function SKTLEnterKeySearch(pm){
    SiebelAppFacade.SKTLEnterKeySearch.superclass.constructor.call(this,pm);
    }
    SiebelJS.Extend(SKTLEnterKeySearch, SiebelAppFacade.PhysicalRenderer);
    SKTLEnterKeySearch.prototype.BindEvents = function(){
    SiebelAppFacade.SKTLEnterKeySearch.superclass.BindEvents.call(this);
    Search.call(this);
    };

    function Search() {
    var oPM = this.GetPM();
    var sAppletId = “#S_A”+oPM.Get(“GetId”);
    //alert(sAppletId);
    $(sAppletId).keypress(function(event){
    var keycode = (event.keyCode ? event.keyCode : event.which);
    var that = this;
    if(keycode == ’13’){
    alert(‘Enter Pressed’);
    that.GetPM().ExecuteMethod(“InvokeMethod”, “Mirror Search GotoView”);
    };
    });
    }
    return SKTLEnterKeySearch;
    }());
    return “SiebelAppFacade.SKTLEnterKeySearch”;
    });
    }

Leave a Reply

Contribute