1. #1
    Sencha User
    Join Date
    Oct 2008
    Posts
    30
    Vote Rating
    0
    protocyber is on a distinguished road

      0  

    Default Cannot Display Error Mark for Field Inside Tab

    Cannot Display Error Mark for Field Inside Tab


    I try to return the following error message after submitting form data:

    Code:
    {
        success: false,
        msg: 'Please re-enter invalid data.',
        errors: {testField: 'Test message'}
    }
    testField is the name of field which is located inside tab.

    If I replace testField with another field-name located outside the tab, the invalid mark is displayed properly.

    How to solve this problem?? Thank you very much.

    UPDATE: Here is the code of the form panel:
    Code:
    Ext.define('App.view.siswa.FormTambah', {
        extend: 'App.widget.FormTambah',
        alias : 'widget.edu-formTambahSiswa',
    
    
        title : 'Input Data Siswa',
        width: 700,
        height: 450,
    
    
        initComponent: function() {
            this.items = [{
                xtype: 'form',
                url: baseUrl + 'Siswa/tambah.html',
                bodyPadding: 20,
                layout: {
                    type: 'hbox',
                    align: 'stretch'
                },
                items: [{
                    xtype: 'container',
                    width: 128,
                    items: [{
                        xtype: 'container',
                        style: 'text-align: center',
                        html: '<img src="images/icon_128/emblem-person.png" width="128" height="128"/>'
                    }]
                }, {
                    xtype: 'container',
                    layout: {
                        type: 'vbox',
                        align: 'stretch'
                    },
                    flex: 1,
                    margins: '0 0 0 20',
                    items: [{
                        xtype: 'container',
                        layout: 'anchor',
                        margins: '0 0 23 0',
                        defaults: {
                            xtype: 'textfield',
                            labelWidth: 135,
                            labelSeparator: '',
                            allowBlank: false
                        },
                        items: [{
                            xtype: 'numberfield',
                            name : 'nomorInduk',
                            fieldLabel: 'Nomor Induk',
                            hideTrigger: true,
                            allowDecimals: false,
                            minValue: 0
                        }, {
                            name : 'nama',
                            fieldLabel: 'Nama',
                            width: 454
                        }, {
                            xtype: 'edu-comboBoxKelas',
                            name : 'kelas',
                            fieldLabel: 'Kelas'
                        }]
                    }, {
                        xtype: 'tabpanel',
                        flex: 1,
                        bodyStyle: 'padding-top: 10px',
                        border: false,
                        plain: true,
                        items: [{
                            xtype: 'container',
                            title: 'Data Siswa',
                            layout: 'anchor',
                            defaults: {
                                xtype: 'textfield',
                                labelWidth: 135,
                                labelSeparator: ''
                            },
                            items: [{
                                xtype: 'numberfield',
                                name : 'testField',
                                fieldLabel: 'NISN',
                                hideTrigger: true,
                                allowDecimals: false,
                                minValue: 0
                            }, {
                                xtype: 'filefield',
                                name: 'foto',
                                fieldLabel: 'Foto',
                                iconCls: 'upload16',
                                buttonOnly: true,
                                buttonText: 'Pilih Foto...',
                                buttonConfig: {
                                    iconCls: 'upload16'
                                }
                            }]
                        }, {
                            xtype: 'container',
                            title: 'Data Keluarga',
                            layout: 'anchor',
                            autoScroll: true,
                            defaults: {
                                xtype: 'textfield',
                                labelWidth: 135,
                                labelSeparator: ''
                            },
                            items: [{
                                xtype: 'fieldcontainer',
                                fieldLabel: 'Anak Ke',
                                layout: 'hbox',
                                defaults: {
                                    xtype: 'numberfield',
                                    allowDecimals: false,
                                    labelSeparator: '',
                                    labelWidth: 100
                                },
                                items: [{
                                    name: 'anakKe',
                                    minValue: 1,
                                    width: 50,
                                    margins: '0 35 0 0'
                                }}]
                            }, {
                                xtype: 'fieldcontainer',
                                fieldLabel: 'Data Ayah',
                                defaults: {
                                    xtype: 'textfield',
                                    labelSeparator: '',
                                    labelWidth: 80
                                },
                                items: [{
                                    name: 'namaAyah',
                                    fieldLabel: 'Nama Ayah',
                                    width: 314
                                }]
                            }, {
                                xtype: 'fieldcontainer',
                                fieldLabel: 'Data Ibu',
                                defaults: {
                                    xtype: 'textfield',
                                    labelSeparator: '',
                                    labelWidth: 80
                                },
                                items: [{
                                    name: 'namaIbu',
                                    fieldLabel: 'Nama Ibu',
                                    width: 314
                                }]
                            }]
                        }]
                    }]
                }]
            }];
    
    
            this.callParent(arguments);
        }, // initComponent
        
        onShow: function(){
            this.down('tabpanel').setActiveTab(0);
            this.callParent(arguments);
        }
    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Is the testfield registered with the basic form?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Oct 2008
    Posts
    30
    Vote Rating
    0
    protocyber is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Is the testfield registered with the basic form?
    Yes, of course. The testField is inside the tab panel. And the tab panel is inside form panel.

    I've updated my previous post. Please see the form panel's code in my post above.

  4. #4
    Sencha User
    Join Date
    Oct 2008
    Posts
    30
    Vote Rating
    0
    protocyber is on a distinguished road

      0  

    Default


    Any solution??

Thread Participants: 1