2012-08-02 53 views
0

在我的應用程序中,我在屏幕底部有一個選項卡面板。這三個標籤是主頁,添加願望日誌和添加反饋。現在當我點擊主頁標籤時,它會顯示一些圖標。在Add Wishlog和Add Feedback選項卡中,我添加了一些文本框和一些按鈕。我加入了addwishlog標籤像下面的屏幕沒有得到tabpanel的文本框值?

{ 
     xtype : 'addwishlog', 
     styleHtmlContent : true, 
     title : '+ Wishlog', 
     iconCls : 'favorites', 
    }, 

這裏是addwishlog.js文件:::

Ext.define('MyApp.view.AddtoWishlog', { 
        extend : 'Ext.Container', 
        xtype : 'addwishlog', 
        config : { 
         ui : 'light', 
         scrollable: { 
          direction: 'vertical', 
          directionLock: true 
         }, 
         items : [ 
           { 
            xtype : 'container', 
            id : 'LoginScreen', 
            docked : 'top', 
            items : [ 
              { 
               xtype : 'image', 
               docked : 'left', 
               height : 92, 
               id : 'Logoimage', 
               ui : '', 
               width : 120, 
               src : 'app/images/small_logo.png' 
              }, 
              { 
               xtype : 'titlebar', 
               cls : 'mytitlebar', 
               docked : 'top', 
               height : 80, 
               ui : 'blue', 
               items : [ { 
                xtype : 'label', 
                height : 36, 
                html : 'Add to Wishlog', 
                id : 'title', 
                margin : 20, 
                style : 'font: normal Bold 20px droid sans; color:#AB3951', 
               } ] 
              } ] 
           }, 
           { 
            xtype : 'panel',          
            autoHeight: true, 
            items: [{ 
             xtype : 'container', 
             id : 'dashboardiconcontainer', 
             height: 400, 
             layout: 'vbox', 
             items : [ 
               { 
                xtype : 'container', 
                id : 'topitembox', 
                layout : { 
                 type : 'hbox' 
                }, 
                margin : '10 0 0 10', 
                height : 50, 
                items : [ { 
                 xtype : 'textfield', 
                 id : 'itemname', 
                 labelWidth : '40%', 
                 label : 'Name of the item', 
                 width : 320 
                }, { 
                 xtype : 'textfield', 
                 id : 'barcodetextfield', 
                 width : 300, 
//              value: 'test', 
                 margin : '0 0 0 10', 
                 labelWidth : '40%', 
                 label : 'Enter Barcode' 
                }, { 
                 xtype : 'button', 
                 height : 40, 
                 scope: this, 
                 margin : '0 0 0 10', 
                 id : 'scanbutton', 
                 ui : 'orange', 
                 width : '80', 
                 text : 'scan barcode' 
                } ] 
               }, 

               { 
                xtype : 'container', 
                height : 160, 
                id : 'cameraimagecontainer', 
                margin : '10 0 0 10', 
                layout : { 
                 type : 'hbox' 
                }, 
                items : [ 
                  { 

                   html : '<img style="width:180px; height:150px;display:none;" id="capturedimage" src="" />' 
                  }, 
                  { 
                   xtype : 'container', 
                   id : 'btncontainer', 
                   width : 120, 
                   margin : '0 0 0 10', 
                   layout : { 
                    type : 'vbox' 
                   }, 
                   items : [ 
                     { 
                      xtype : 'button', 
                      height : 73, 
                      cls : 'capturebtn', 
                      id : 'capturebtn', 
                      width : 100 
                     }, 
                     { 
                      xtype : 'button', 
                      height : 73, 
                      margin : '10 0 0 0', 
                      cls : 'choosephotobtn', 
                      id : 'selectphoto', 
                      width : 100 
                     } ] 
                  }, 

                  { 
                   xtype : 'container', 
                   id : 'additionalinfo', 
                   margin : '10 0 0 10', 
                   width : 400, 
                   layout : { 
                    type : 'vbox' 
                   }, 
                   items : [ 
                     { 
                      xtype : 'textareafield', 
                      height : 80, 
                      width : 380, 
                      id : 'additionalinfo', 
                      label : 'Add Additiona Details', 
                      labelWidth : '40%', 
                      placeHolder : '' 
                     }, 
                     { 
                      xtype : 'selectfield', 
                      margin : '5 0 0 0', 
                      width : 300, 
                      label : 'Select Category', 
                      options : [ 
                        { 
                         text : 'Food', 
                         value : 'first' 
                        }, 
                        { 
                         text : 'Sports', 
                         value : 'second' 
                        }, 
                        { 
                         text : 'Electronics', 
                         value : 'third' 
                        } ], 
                      labelWidth : '40%' 
                     }, 
                     { 
                      xtype : 'textareafield', 
                      id : 'Addmoretag', 
                      margin : '10 0 0 0', 
                      width : 320, 
                      placeHolder : 'Add any other tags you want ' 
                     }, 
                     { 
                      xtype : 'button', 
                      height : 54, 
                      id : 'Addwishlog', 
                      margin : '10 0 0 0', 
                      ui : 'orange', 
                      width : 250, 
                      text : 'Add to my wishlog' 
                      } 

                     ] 
                  } ] 
               } ] 
            }] 
           } ] 
        } 
       }); 

用同樣的方法,我也做了addFeedback。現在,當我試圖從addWislog屏幕獲取任何文本字段的值時,我收到錯誤。有的時候就是告訴的getValue()方法是不是這個object..while試圖做使用

this.getIDofTextbox().getValue(); 

雖然我參加了控制器正確的引用。如果我想使用getCmp(),我得到空值。

我真的很困惑,因爲對於其他屏幕,我從文本框中獲取值。我只在這個tabpanel js文件中遇到問題。

這裏是我的app.js文件:

Ext.Loader.setConfig({ 
    enabled : true 
}); 

Ext.application({ 
    views : ['dashboardpanel', 'TitlePanel', 'wishlogsummary', 'ConsumerSignup', 'FeedbackSummary', 'ConsumerSignin', 'AddFeedback'], 
    models : [ 'MyModel', 'wishlistmodel', 'feedbacksummarymodel' , 'loginmodel'], 
    stores : [ 'name', 'wishlistsummarystore', 'feedbacksummarystore' ], 
    name : 'MyApp', 
    controllers : [ 'MyController' ], 
    requires:['Ext.ux.touch.Rating'], 

    fullscreen: true, 


    launch : function() { 

     var Login = { 
       xtype: 'login' 
     } 
     var Dashboard = { 
       xtype: 'dashboard' 
     } 

     var Wishlogsummary = { 
       xtype: 'wishlogsummarylist' 
     } 

     var AddtoWishlog = { 
       xtype: 'addwishlog' 
     } 
     var Consumersignup = { 
       xtype: 'consumersignup' 
     } 
     var FeedbackSummaryList = { 
       xtype: 'feedbacksummarylist' 
     } 
     var Consumersignin = { 
       xtype: 'Consumersignin' 
     } 

     Ext.Viewport.add([Login,Dashboard,Wishlogsummary, FeedbackSummaryList,Consumersignup,Consumersignin]); 
    } 

}); 

難道我必須改變應用程序架構的東西?

請幫助,因爲我卡在這個問題上半晌,不能夠找出解決辦法..

回答

0

其實,有在我的建築有些問題。現在我可以修復它。