Results 1 to 4 of 4

Thread: Need help with the getForm().loadRecord(record) method. not working

  1. #1

    Default Need help with the getForm().loadRecord(record) method. not working

    Hi ,

    I have a window which have a tab panel having three tabs and in one of them , i have a form panel, So while loading the window, I am giving a DWR call to get the banker record inside the Onrender method of the window panel and trying to load the response object to the form panel

    the code looks like this:

    onRender: function(ct, position) {

    BankerService.getBanker(bankerid, function(ExtForm){

    //banker the ref object for the tab panel
    //details ref object from the banker form panel
    //banker is the java model (bean class) which has all the banker values

    this.banker.details.getForm().loadRecord(ExtForm.data.banker);

    }.createDelegate(this));
    }

    In the reponse object i was able to get all the values inside the render function, but the values are not getting set into the from panel variables. Below is the code block for the form panel

    ILC.ui.bankerDetailForm = Ext.extend(Ext.FormPanel,{

    initComponent:function() {

    var config = {
    ref: '/details',
    frame:true,
    bodyStyle: 'padding: 0px 5px 0px 5px;',

    //width:680,
    items: [{
    layout:'column', //Layout defined for the from panel
    items:[{ //First Column starts here
    columnWidth:.5,
    layout: 'form',
    anchor:'96%',
    labelWidth: 133,
    bodyStyle: 'padding:5px;',
    items: [{ // Column -1 : Row -1
    xtype: 'fieldset',
    title: 'Installation Information',
    autoHeight: true,
    readOnly: true,
    items :[
    {
    xtype: 'displayfield',
    fieldLabel: 'bankerNumber',
    name: 'bankNumber',
    id:'mNumber'
    },
    {
    xtype: 'displayfield',
    fieldLabel: 'Lat/Long',
    name: 'lattitude',
    },
    .........

    This code is not throwing any errors or warnings.. but the form is just not getting populated.

    Any pointers would be of great help.

    Thanks
    jazz

  2. #2
    Sencha User
    Join Date
    Aug 2009
    Posts
    8

    Default

    Same here ):

  3. #3
    Sencha User
    Join Date
    May 2010
    Posts
    45

    Default

    I don't think there is an onRender event on Ext.Window class, try to change the line bellow

    PHP Code:
    onRender: function(ctposition) { 
    to

    PHP Code:
    render: function(ctposition) { 
    hope this helps

  4. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791

    Default

    @diegotdai, I believe jazz is overriding the onRender() method, not adding an event listener. The comment on that method in the source claims it is private but as with so many Ext methods there's a fine line between genuinely private methods and protected template methods.

    A few suggestions...

    1. Perhaps, as diegotdai suggests, you'd be better off using an event listener.
    2. Your override doesn't call the superclass implementation. The use of createDelegate() is also worrying.
    3. Have you tried overriding the afterRender() method instead, or listening to the afterrender event?
    4. Try calling loadRecord() after a time delay (using defer()). This will help to confirm whether it is simply a timing issue or whether your call to loadRecord() is just plain not working.
    5. Do the names on your fields definitely match the names in your record?
    6. Have you tried adding a break point on loadRecord() and stepping into the code to see why it doesn't work?

Similar Threads

  1. LoadRecord not working !!Weird!!
    By tBSTAR in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 29 Dec 2010, 1:31 PM
  2. Replies: 5
    Last Post: 22 Apr 2010, 7:03 AM
  3. [CLOSED] Record setDirty method not working
    By micgala in forum Ext GWT: Bugs (2.x)
    Replies: 2
    Last Post: 26 Jan 2010, 7:57 AM
  4. Record set() method not working property with value '0'
    By liotrox in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 23 Mar 2007, 2:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •