Search code examples
tabspanelbada

bada Programming - Tab and Panel


I am currently doing an app with tabs with panels. I have tried following the TabSample provided here: http://developer.bada.com/help/index.jsp?topic=/com.osp.cppapireference.help/classOsp_1_1Ui_1_1Controls_1_1Panel.html and the BasicApp (for usage of panels) provided in the IDE. The app has 2 tabs, tab1 and tab2. In tab1, there is a button and a label, once the button is clicked, it will change the text in the label and appLog it. The problem I am currently facing is that when I can't even click on the button, it does not respond (no response for button and label and applog), I have to click on tab2 then click back to tab1 in order for the button to work/respond. May I know how to solve this?

Many thanks in advance!


Solution

  • I kept trying and looking out what's wrong with the TabForm and realized the problem and solved it by adding these lines of code in TabForm::OnInitializing(void) :

    if (pTab)
    {
        pTab->SetSelectedItem(__panelId);
    
        __pPanel[0]->SetShowState(false);
        __pPanel[1]->SetShowState(false);
        __pPanel[__panelId]->SetShowState(true);
    }