We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38925
    • 38 Posts
    Hi all !

    Does anyone know why with this :

     xtype: 'textfield'
                        ,fieldLabel: 'label'
                        ,description: 'description'
                        ,name: 'group'
                        ,id: 'importusersx-group-name'


    I only get a field, not the label ?

    I'm in Revolution 2.2.1.

    Thanks !
      • 33976 ☆ A M B ☆
      • 571 Posts
      Hi,

      So far nothing looks bad (to me). That might be because of the container having some default values, like hideLabel: true... (just an idea tho).

      Hope that will help
        • 38925
        • 38 Posts
        Still not working, even with an hideLabel. I'll tried to rewrite an existing CMP without copy/paste and see what happens.

        Thank you anyway ! I keep you posted
          • 33976 ☆ A M B ☆
          • 571 Posts
          tzoreol,

          You get me wrong, the "hideLabel" parameter will hide the fieldLabel (sometime usefull, for example for checkboxes).

          If you dont mind pasting your whole code, someone might find if there is an issue smiley

          Cheers
            • 38925
            • 38 Posts
            Here is my code. Since it doesn't work, I removed the fielLabel. I added one this morning right after reading your post but no change. I hope you can see something in there !

            importUsersX.panel.Home = function(config) {
                config = config || {};
                Ext.apply(config,{
                    border: false
            		,buttons: [{
            			text: 'Go !'
                        ,id: 'importusersx-btn-export'
                        ,process: 'import'
                        ,method: 'remote'
            		}]
                    ,baseCls: 'modx-formpanel'
                    ,cls: 'container'
                    ,items: [{
                        html: '<h2>' + _('importusersx') + '</h2>'
                        ,border: false
                        ,cls: 'modx-page-header'
                    },{
                        xtype: 'modx-panel',
                        items: [{
                                    html: '<br/><label>Nom du Groupe : </label>',
                                    border: false,
            						cls: 'x-form-item-label'
                                },{
                                    xtype: 'textfield',
            						hideLabel: false,
            						fieldLabel: 'Nom du Groupe', //added for test
                                    name: 'groupName',
                                    id: 'groupName',
                                    anchor: '100%',
                                    allowBlank: false,
                                    blankText: _('importusersx.noGroupName')
                                },{
                                    html: '<br/><label>Chunk Email Admin :</label>',
                                    border: false,
            						cls: 'x-form-item-label'
                                },{
                                    xtype: 'textfield', 
                                    name: 'chunkAdmin',
                                    id: 'chunkAdmin',
                                    anchor: '100%',
                                    allowBlank: false,
                                    blankText: _('importusersx.noGroupName')
                                },{
                                    html: '<br/><label>Chunk Email User :</label>',
                                    border: false,
            						cls: 'x-form-item-label'
                                },{
                                    xtype: 'textfield', 
                                    name: 'chunkUser',
                                    id: 'chunkUser',
                                    anchor: '100%',
                                    allowBlank: false,
                                    blankText: _('importusersx.noGroupName')
                                },{
                                    html: '<br/><label>Fichier CSV :</label>',
                                    border: false,
            						cls: 'x-form-item-label'
                                },{
                                    xtype: 'textfield',
                                    name: 'csv-file',
                                    id: 'csv-file',
                                    inputType: 'file'
                                },{
                                    html: '<br/><label>Admin username :</label>',
                                    border: false,
            						cls: 'x-form-item-label'
                                },{
                                    xtype: 'textfield', 
                                    name: 'adminUsername',
                                    id: 'adminUsername',
                                    anchor: '100%',
                                    allowBlank: false,
                                    blankText: _('importusersx.noGroupName')
                                }]
                            }
            			]
                });
                importUsersX.panel.Home.superclass.constructor.call(this,config);
            };
            Ext.extend(importUsersX.panel.Home,MODx.Panel);
            Ext.reg('importusersx-panel-home',importUsersX.panel.Home);
              • 1778
              • 659 Posts
              Hello
              Try this
              ...
              xtype: 'modx-panel',
              layout: 'form',
              items: [{ //your fields }]
              ...
              

              It should be enough to display the fieldLabels... What is happening is that xtype 'modx-panel' acts and displays things as a panel, if you want to have it acting and displaying things as a form you have to specify a layout 'form'...
              Let us know if ti solves your problem...
              Cheers
                • 38925
                • 38 Posts
                It works now ! Thank you !

                May I ask another question : How can I run a php code when the user click on the button ? I have some difficulties to understand that.

                Thank you again, you almost saved my day laugh