Monday, February 8, 2016

Classes not reloading in IDE when using JRebel

A lot of times when we use JRebel and use our IDE, on modifying any file, we expect JRebel to load the file automatically.

But, alas, that does not happen! Ever wondered why????

Just ensure that there are no compile time errors in your IDE.

That is the only fix. I know it is silly, but that is the solution.

Happy coding and continue using JRebel, it really rocks :)

Monday, November 9, 2015

EXTJS: Model ID appended to the AJAX/REST URL

While verifying the upgrade to EXTJS 6, I noticed that the URL(AJAX/REST) had the model id appended to it. Because of this, the calls were not reaching the server.
To mitigate this issue, I used the following fix:
Add the below snippet in the beforesync() listener in the store.

 beforesync: function(){  
    Ext.override(Ext.data.proxy.Rest, {  
     buildUrl: function(request) {  
      for (var i = 0; i< arguments.length; i++) {  
       if(arguments[i]._action != "read" && arguments[i]._records != undefined){  
        var argData = arguments[i]._records[0];  
        delete argData.id;  
       }  
      };  
      return this.callParent(arguments);  
     } });  
    }