Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Upgrading from SmartGWT 4.0p to 4.1p ListGrid problem

    Hi,

    I have a regression on ListGridField setHidden / setFields

    My problem is:

    I have a ListGrid with 30 ListGridField separated in 3 tab, the display is dynamically evaluated using setHidden().

    Tab Valeur :
    premod_bareme_lettre, rubrique_bareme_code, rubrique_bareme_lfra,
    premod_bareme_val_00, premod_bareme_val_01, premod_bareme_val_02, premod_bareme_val_03,
    premod_bareme_val_04, premod_bareme_val_05, premod_bareme_val_06, premod_bareme_val_07,
    premod_bareme_val_08, premod_bareme_val_09, premod_bareme_val_10, premod_bareme_val_11

    Tab Evolution :
    premod_bareme_lettre, rubrique_bareme_code, rubrique_bareme_lfra, premod_bareme_val_tb, premod_bareme_val_dm,
    premod_bareme_evo_00, premod_bareme_evo_01, premod_bareme_evo_02, premod_bareme_evo_03,
    premod_bareme_evo_04, premod_bareme_evo_05, premod_bareme_evo_06, premod_bareme_evo_07,
    premod_bareme_evo_08, premod_bareme_evo_09, premod_bareme_evo_10, premod_bareme_evo_11

    Tab Commentaire :
    premod_bareme_lettre, rubrique_bareme_code, rubrique_bareme_lfra, premod_bareme_comment

    In version 4.0p the gridBrm.setFields() works correctly (4.0p-Tab1-valeur.jpg, .0p-Tab2-evolution.jpg),
    but in version 4.1p, display is not performed correctly (4.1p-Tab1-valeur.jpg, 4.1p-Tab2-evolution.jpg, 4.1p-Tab3-commentaire.jpg)

    Best Regards,
    Regis

    - Chrome 33
    - http://www.smartclient.com/builds/SmartGWT/4.1p/LGPL/2014-03-03/smartgwt-4.1p.zip
    - Gwt : gwt-2.6.0




    Code:
            _brmtab.addTabSelectedHandler(new TabSelectedHandler() {
                public void onTabSelected(TabSelectedEvent event) {
                    switch(event.getTabNum()) {
                        case 0: //  Tab Pictogramme
                            formcpy.disable();
                            break;
                        case 1: //  Tab Valeur
                            setValOnglet(0, _acces);
                            formcpy.enable();
                            break;
                        case 2: //  Tab Evolution
                            setValOnglet(1, _acces);
                            formcpy.disable();
                            break;
                        case 3: //  Tab Commentaire
                            setValOnglet(2, _acces);
                            formcpy.disable();
                            break;
                    }
                }
            });
    
        ...
    
        private void setValOnglet(int _num, boolean acces) {
            for(int i = 0 ; i < TypeAction.length ; i++)
                for(int j = 0 ; j < NB_TAILLE_MAX ; j++) {
                    ListGridField _fld = _chpBrm[j + TypeAction[i]];
                    if((!acces && !_fld.getTitle().equals("   "))
                    || ( acces && _fld != null && _fld.getCanEdit()))
                        _fld.setHidden(_num != 2 && _num == i ? false : true);
                }
    
            _chpBrm[15].setHidden(_num == 1 ? false : true);
            _chpBrm[16].setHidden(_num == 1 ? false : true);
            _chpBrm[29].setHidden(_num == 2 ? false : true);
    
            for(int h = 0 ; h < TypeAction[0] ; h++) {
                ListGridField _fld = _chpBrm[ h ];
                if(_fld != null)
                    _fld.setCanEdit(!acces || _num == 2 ? false : true);
            }
            gridBrm.setFields(_chpBrm);
        }
    Attached Files

    #2
    We can't help you debug with just these small snippets of code and some screenshots, but if you can provide ready-to-run code that clearly demonstrates a framework problem, we can take a look.

    Comment

    Working...
    X