1. #1
    Sencha User chrizmaster's Avatar
    Join Date
    Feb 2009
    Location
    Australia
    Posts
    441
    Vote Rating
    1
    chrizmaster is on a distinguished road

      0  

    Default Some common questions

    Some common questions


    Hi folks,

    I have a couple of questions. It would be nice, to get an answere..

    as you can see, I've created a function to create a Window.

    1) In this case, this should be a login window. But how the hell can I tell this button not to be in the middle, but at the right side of the window. something like a position tag or so.

    2) Also, I saw some issues about Panels.. Why do I need Panels? I mean where exactly is the benefit if i am using it, instead of just putting all my elements directly to the window?

    3) What kind of programming style is a good one? Recently I worked at a very big Java Project and I really liked the structure there. So I am new at EXTjs, and I am searching for a simliar kind of structure.
    Is it a good style, to create a new js File for every component I am writing? if so, is there another posibillity, to use all the components in my index.html? Currentyl I am include all the scripts like this: <script lanuage="text/javascript" src="..."></script>

    Thank u guys for your help
    Chriz
    PHP Code:
    function createWindow(p_widthp_heightp_title){
        
    var 
    win = new Ext.Window({
        
        
    widthp_width,
        
    heightp_height,
        
    resizabletrue,
        
    maximizabletrue,
        
    titlep_title,

        
    items:[{
            
    xtype:'form'
            
    ,id:'testform'
            
    ,defaultType:'textfield'
            
    ,frame:true
            
    ,defaults:{anchor:'95%'}
            ,
    items:[
                {
                    
    fieldLabel:'Username:'
                    
    ,id:'username'
                
    },
                {
                    
    fieldLabel:'Password:'
                    
    ,id:'password'
                
    }
            ]
            ,
    buttons:[{
                
    formbind:true,
                
    text"moin",
                
    handler:function(){
                    
    Ext.Msg.alert("test");
                }
            }]
        }]
        
    })
     
    win.show();    


  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    89
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    1. buttonAlign:'right'.

    2. Panels are widely overused. In most cases (like yours) you don't need an extra Panel.
    You need an extra container (can be a simple Container, not even a Panel) if you want some items inside a layout to be layed out differently (e.g. form layout inside a column layout).

    3. Yes, creating a file for every component is good practice.
    During testing you should indeed include all files separately, but for the final distribution you should merge, compress (use YUICompressor) and gzip the result.

  3. #3
    Sencha User chrizmaster's Avatar
    Join Date
    Feb 2009
    Location
    Australia
    Posts
    441
    Vote Rating
    1
    chrizmaster is on a distinguished road

      0  

    Default


    thank you for your reply. you really helped me out dude.

    ok, here's another one (i am still learning...)

    1) What I want to do is that the user calls the Web-App like http://www.foo.de/webapp
    Now the first thing this user should see is this login dialog. If the user's logn was succesfully, he/she should be forwarded to the main page.

    Will it be the best thing, to work with cookies / sessions? I think about creating 2 jsp pages. in the index page, there's only the dialog displayed. If all is ok, the user is forwarded to the main page, or something like that.

    2) if I understand the concept correct, I have to use only 1, maximum 2 html/jsp page(s) and all the action is done by some JavaScripts. (This is completly new for me, as I told u I am comming from the java side with as much classes as possible )

    Thanks
    Chriz

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    89
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    1. Yes, you could create 2 pages and forward (remember to use standardSubmit:true, because an XHR request won't follow the forward). Or you could just create 1 page and make the login window modal:true.

    2. Yes, your entire application can consist of:
    - one HTML page
    - one or more javascript files
    - one or more css files (+images).

  5. #5
    Sencha User chrizmaster's Avatar
    Join Date
    Feb 2009
    Location
    Australia
    Posts
    441
    Vote Rating
    1
    chrizmaster is on a distinguished road

      0  

    Thumbs up


    ok, thank u very much.

  6. #6
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Suggest you scan the main wiki tutorials page. There's some articles on design/layout of code, suggestions on writing large applications, minification, etc.

    There are a few examples of logins about (sample apps, etc.). I think you have the drift of the login already though.

Thread Participants: 2