دوجوكس.المحمول.كيرنتفيو لاغية بعد الانتقال من علامة تبويب إلى أخرى

StackOverflow https://stackoverflow.com//questions/11688519

سؤال

أنا أستخدم عناصر التحكم في علامة التبويب التالية :

function tweetsAction()
{
    var w = dojox.mobile.currentView;
    if (w.id != "tweetsView") w.performTransition('tweetsView', 1, "slide", null);
}

function secondAction()
{
    var w = dojox.mobile.currentView;
    if (w.id != "secondView") w.performTransition('secondView', 1, "slide", null);
}

function thirdAction()
{
    var w = dojox.mobile.currentView;
    if (w.id != "thirdView") w.performTransition('thirdView', 1, "slide", null);
}

تهيئة لهم في وركليت جافا سكريبت ، مثل :

function initCommonControls()
{
    console.log("Android initCommonControls");

    WL.TabBar.init();
    WL.TabBar.addItem("tweetsView", tweetsAction, "Tweets", {image:"images/icons/help_bw.png", imageSelected:"images/icons/help.png"});
    WL.TabBar.addItem("secondView", secondAction, "Second", {image:"images/icons/help_bw.png", imageSelected:"images/icons/help.png"});
    WL.TabBar.addItem("thirdView", thirdAction, "Third", {image:"images/icons/help_bw.png", imageSelected:"images/icons/help.png"});

    WL.TabBar.setSelectedItem("tweetsView");
}

تظهر علامات التبويب موافق على إطلاق التطبيق :

enter image description here

ومع ذلك ، عند النقر فوق علامة التبويب الثانية أو الثالثة ، يتحرك كلاهما فوق علامة التبويب الأولى :

enter image description here

وأرى هذا الخطأ جافا سكريبت في وحدة التحكم جس :

نوع غير معروف خطأ:لا يمكن قراءة خاصية 'معرف' غير معرف

وهو ما يعني أن `فار ث = دوجوكس.المحمول.كيرنتفيو;غير قادر على الحصول على العرض الحالي بعد الانتقال من علامة التبويب الأولية.

هذا هو ما يبدو أتش تي أم أل :

<!-- Tweets View -->
    <div id="tweetsView" data-dojo-type="dojox.mobile.ScrollableView" data-dojo-props="selected: true">
        <div class="spacing"></div>
        <h1 id="head0" data-dojo-type="dojox.mobile.Heading" 
            data-dojo-props="label:'Tweet Search', fixed:'top'"></h1>
        <button onclick="getTweets()">Get Tweets</button>
        <input data-dojo-type="dojox.mobile.TextBox" id="sampleItem">
        <ul data-dojo-type="dojox.mobile.EdgeToEdgeList" id="theTable"
            class="tweetviewList">
        </ul>
    </div>

    <!-- second View -->
    <div id="secondView" data-dojo-type="dojox.mobile.ScrollableView" data-dojo-props="selected:false">
        <div class="spacing"></div>
        <h1 data-dojo-type="dojox.mobile.Heading" 
            data-dojo-props="label:'second view', fixed:'top'"></h1>
        This is a second view
    </div>

    <!-- third View -->
    <div id="thirdView" data-dojo-type="dojox.mobile.ScrollableView" data-dojo-props="selected:false">
        <div class="spacing"></div>
        <h1 data-dojo-type="dojox.mobile.Heading" 
            data-dojo-props="label:'third view', fixed:'top'"></h1>
        This is a third view
    </div>

أي أفكار لماذا dojox.mobile.currentView لا يعود شيئا بعد تبديل علامة تبويب?

هل كانت مفيدة؟

المحلول

أعتقد أنه مرتبط بهذا: http://bugs.dojotoolkit.org/ticket/15040.يبدو أنهم أزالوا دوجوكس.المحمول.كيرنتفيو من أحدث إصدارات دوجو موبايل.أنا أفعل حاليا بعض الاشياء مع وركليت وأنا أيضا الحصول على 'غير معروف' ل دوجوكس.المحمول.كيرنتفيو.

هناك بعض التوصيات في تلك الصفحة ، ولكن يبدو أن كل شيء يحتاج الآن إلى أن يكون أكثر تعقيدا-ياي: (

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top