1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    28
    Answers
    2
    Vote Rating
    0
    alexgrimaldi is on a distinguished road

      0  

    Default Answered: My Ext.form.Panel object does not want to show

    Answered: My Ext.form.Panel object does not want to show


    Hi all,

    I am very new to Sencha Touch 2, so sorry for the stupid question. I am trying to display a form on a screen. I want to define my form in a separate file (LoginForm) and then call this file from my view (Viewport) using xtype. I have been follwing few tutorials and cannot see what I am doing wrong yet. Can you please help?

    This is my LoginForm file:

    Code:
    Ext.define('CloudClient.view.component.custom.LoginForm', {
        extend: 'Ext.form.Panel',
        xtype: 'ccl-loginform',
    
    
        config: {
            items: [
                {
                    xtype: 'fieldset',
                    title: 'Title',
                    instructions: 'please login',
                    layout: 'vbox',
    
    
                    defaults: {
                        labelWidth: '200px'
                    },
    
    
                    items: [
                        {
                            xtype: 'textfield',
                            name: 'username',
                            label: 'Username',
                            placeHolder: 'Username' ,
    
    
                        },
                        {
                            xtype: 'passwordfield',
                            name: 'password',
                            label: 'Password'
                            placeHolder: 'Password'
                        }
                    ]
                },
                {
                    xtype: 'button',
                    text: 'Sign in',
                    action :'loginaction'
    
    
                }
            ]
        },
        initialize: function() {
            this.callParent(arguments);
            console.log('loginform:initialize');
        }
    });
    This is my app.js

    Code:
    Ext.Loader.setConfig({
        enabled: true
    });
    
    
    Ext.application({
    
    
        name: 'CloudClient',
    
    
        appFolder: 'app',
    
    
        requires: [
    
    
        ],
    
    
        controllers : [
            'CloudClient.controller.LoginController'
        ],
    
    
        views : [
            'CloudClient.view.Viewport',
            'CloudClient.view.component.custom.LoginForm',
            'CloudClient.view.component.custom.ScreenHeader',
            'CloudClient.view.component.custom.SupportInfo',
        ],
    
    
        models: [
    
    
        ],
    
    
        stores: [
    
    
        ],
    
    
        autoCreateViewport: true,
    
    
        launch: function () {
            Ext.create('CloudClient.view.Viewport')        
        }
    });
    This is my viewport

    Code:
    Ext.define('CloudClient.view.Viewport', {
        extend: 'Ext.Panel',
    
    
        xtype: 'ccl-viewport',
    
    
        config: {
            fullscreen:true,
            scrollable: true,
            layout:'vbox',
            items: [
                { xtype: 'ccl-screenheader' },
                { xtype: 'ccl-loginform'},
                { xtype: 'ccl-supportinfo'}
            ]
        }
    });

  2. You need to tell the form to have a size. Here is an example:

    Code:
    Ext.define('CloudClient.view.Viewport', {
        extend: 'Ext.Panel',
        xtype: 'ccl-viewport',
    
        config: {
            fullscreen:true,
            scrollable: true,
            layout:{
                type  : 'vbox',
                align : 'stretch'
            },
            items: [
                { xtype: 'ccl-screenheader' },
                { xtype: 'ccl-loginform', flex : 1},
                { xtype: 'ccl-supportinfo'}
            ]
        }
    });
    Changes in red.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,756
    Answers
    3462
    Vote Rating
    828
    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


    You need to tell the form to have a size. Here is an example:

    Code:
    Ext.define('CloudClient.view.Viewport', {
        extend: 'Ext.Panel',
        xtype: 'ccl-viewport',
    
        config: {
            fullscreen:true,
            scrollable: true,
            layout:{
                type  : 'vbox',
                align : 'stretch'
            },
            items: [
                { xtype: 'ccl-screenheader' },
                { xtype: 'ccl-loginform', flex : 1},
                { xtype: 'ccl-supportinfo'}
            ]
        }
    });
    Changes in red.
    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.

  4. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    28
    Answers
    2
    Vote Rating
    0
    alexgrimaldi is on a distinguished road

      0  

    Default


    It worked! ... Thank you so much

  5. #4
    Sencha User
    Join Date
    Mar 2012
    Posts
    4
    Vote Rating
    0
    german.larrosa is on a distinguished road

      0  

    Default


    Hi,

    I use the above recommendation (adding the layout config option and the flex option) but I couldnt solve the above problem.

    My scenario is described as following:

    I have defined an Ext.form.FormPanel (within two text fields) inside a custom class (this custom class inherits from an Ext.Panel). So the problem is that I cannot make the formPanel visible inside my custom class.

    The only way to make it visible is adding the height property int the formPanel configuration setting a real value to the height property (i.e '100px' or '10em' since I've tried using percentaje without success).

    I am wondering if there is another way to solve that problem without having to set the formPanel height property with a real value like 100em or 100px.

    Following you can find my code:

    initialize: function() {
    var form = Ext.create('Ext.form.FormPanel', {
    cls: "customForm",
    height: '200px', <----- added option in order to make my formPanel visible
    items: [
    {
    xtype: 'fieldset',
    title: 'Showtimes',
    items: [
    {
    id: 'txtLocationMovie',
    xtype: 'textfield',
    name: 'location',
    label: 'Location'
    }
    ]
    }
    ]
    });

    //add my form to my custom class
    this.add([form]);

    } //end initialize

  6. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    28
    Answers
    2
    Vote Rating
    0
    alexgrimaldi is on a distinguished road

      0  

    Default


    Hi German,

    I see your problem. Having or not having the height param should not make any difference as far as I know. Unfortunately I am not an expert. At the end of day I do not know why this is happening. Sorry!

    Best of luck,
    Alex

  7. #6
    Sencha User jaux's Avatar
    Join Date
    Mar 2012
    Location
    Toronto, ON
    Posts
    5
    Vote Rating
    0
    jaux is on a distinguished road

      0  

    Default


    Quote Originally Posted by german.larrosa View Post
    Hi,

    I use the above recommendation (adding the layout config option and the flex option) but I couldnt solve the above problem.

    My scenario is described as following:

    I have defined an Ext.form.FormPanel (within two text fields) inside a custom class (this custom class inherits from an Ext.Panel). So the problem is that I cannot make the formPanel visible inside my custom class.

    The only way to make it visible is adding the height property int the formPanel configuration setting a real value to the height property (i.e '100px' or '10em' since I've tried using percentaje without success).

    I am wondering if there is another way to solve that problem without having to set the formPanel height property with a real value like 100em or 100px.

    Following you can find my code:

    initialize: function() {
    var form = Ext.create('Ext.form.FormPanel', {
    cls: "customForm",
    height: '200px', <----- added option in order to make my formPanel visible
    items: [
    {
    xtype: 'fieldset',
    title: 'Showtimes',
    items: [
    {
    id: 'txtLocationMovie',
    xtype: 'textfield',
    name: 'location',
    label: 'Location'
    }
    ]
    }
    ]
    });

    //add my form to my custom class
    this.add([form]);

    } //end initialize
    Same problem when I'm trying to use form.Panel inside an DataItem.

  8. #7
    Sencha User
    Join Date
    Apr 2013
    Location
    New York
    Posts
    16
    Answers
    1
    Vote Rating
    0
    scriptonian is on a distinguished road

      0  

    Default explanation

    explanation


    Hello, thanks for your answer... i was lost for 3 days trying to fix this, not knowing why my form panel would not show, and it turned out to be this scrollable property. Can you explain why this is so? need to understand why the panel needs this property set to show.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi