1. #1
    Sencha User
    Join Date
    Feb 2012
    Location
    Paris
    Posts
    108
    Vote Rating
    1
    Tchinkatchuk is on a distinguished road

      0  

    Default Form api : No URL specified when loading

    Form api : No URL specified when loading


    Hi all,

    I have an issue with 4.1 everytime I try tu use Ext.Direct Form Api.
    The issue in trace is :
    Code:
    [E] Ext.data.Connection.setOptions(): No URL specified
    I seems that the api Url are not registered.

    Could anyone help me on this ?
    Is there a difference between define and create on those settings ?

    Here's my form :
    Code:
    Ext.define(    'MINE.view.attribute.admin.attributes.Form',
        {
            extend  : 'Ext.form.Panel',
            xtype   : 'mine-view-attribute-admin-attributes-form',
            id      : 'mine-view-attribute-admin-attributes-form-id',
            
            defaultType     : 'textfield',
            paramsAsHash    : true,
            
            bodyPadding     : 5,
            border          : true,
            disabled        : true,
            
            items           :
            [
                { 
                    xtype: 'textfield',
                    name: 'name',
                    fieldLabel: __('Name'),
                    allowBlank: false
                }
            ],
            
            buttons :
            [
                {
                    iconCls: 'icon-save',
                    tooltip: __('Click here to save updates'),
                    text: __('Update')
                }
            ],
            
            api: 
            {
                // The server-side method to call for load() requests
                load: eav.attributeRetrieve,
                // The server-side must mark the submit handler as a 'formHandler'
                submit: eav.attributeUpdate
            }
            
        }
    );
    Here's my load call
    Code:
    loadAdminAttributeForm: function(view, record, html, index, e, eOpts)    {
            Ext.getCmp('pim-view-attribute-admin-attributes-form-id').load({
                params: 
                {
                    id: record.raw.id
                }
            });
        }

  2. #2
    Sencha - Ext JS Dev Team
    Join Date
    Jun 2011
    Location
    San Diego, CA
    Posts
    195
    Vote Rating
    38
    nohuhu has a spectacular aura about nohuhu has a spectacular aura about

      0  

    Default


    Tchinkatchuk,

    Does your server provide router URL in Ext.Direct API declaration?

    Regards,
    Alex.

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Location
    Paris
    Posts
    108
    Vote Rating
    1
    Tchinkatchuk is on a distinguished road

      0  

    Default


    Hu !

    Yes, my methods are presents and declared as
    ..."attribute":{"name":"update","len":1,"formHandler":true}...

    Strange. I really do not understand what's wrong

  4. #4
    Sencha - Ext JS Dev Team
    Join Date
    Jun 2011
    Location
    San Diego, CA
    Posts
    195
    Vote Rating
    38
    nohuhu has a spectacular aura about nohuhu has a spectacular aura about

      0  

    Default


    Besides the methods, there should be at least two additional properties:

    Code:
    Ext.app.REMOTING_API = {
        actions: { ... },
        url: "/foo",
        type: "remoting"
    }
    Check that your server declares router URL.

    Regards,
    Alex.

  5. #5
    Sencha User
    Join Date
    Feb 2012
    Location
    Paris
    Posts
    108
    Vote Rating
    1
    Tchinkatchuk is on a distinguished road

      0  

    Default


    This is the code I have but no clue. still bugged
    I have :
    Code:
    Ext.app.EXTDIRECT_API = {
        "url":"\/extdirect.php\/dsExtDirect\/router",
        "type":"remoting",
        "actions":{
            .."attribute":{"name":"update","len":1,"formHandler":true}...
        }
    };

  6. #6
    Sencha User
    Join Date
    Feb 2012
    Location
    Paris
    Posts
    108
    Vote Rating
    1
    Tchinkatchuk is on a distinguished road

      0  

    Default


    Strangely, it orks if I declare the api like this :
    Code:
    
        
        constructor: function (config) {
            Ext.applyIf(config, {
                // defaults for configs that should be passed along to the Basic form constructor go here
                api: {
                    submit: category.update
                }
            });
            this.callParent(arguments);
        },
    I do not think it is the good way. Does someone know anything about it ?

  7. #7
    Ext JS Premium Member
    Join Date
    Sep 2010
    Posts
    361
    Vote Rating
    6
    stewardsencha is on a distinguished road

      0  

    Default


    Only that you are not alone:
    http://stackoverflow.com/questions/1...ing-ext-direct

    I got this because the remote API did not specify the method as a form handler.

Thread Participants: 2

Tags for this Thread