Languages

Menu
Sites
Language
tab based form list updation

Hi All,

 I am using a tab based form as we have in examples.

In one tab i am using a list. I am trying to update the list. but in navigation i didnt find any changes in the list.

but it is showing in next installation of app.

When I am adding new items to the list dynamically.. it shows nothing updation. 

I have a doubt regarding this is tab based forms initialises only once or for every navigation. can any one please provide me clear idea.

 

Thanks

Rajyalakshmi

Responses

8 Replies
Alex Ashirov

Hi Rajyalakshmi,

Could you please provide code snippet how you add/update items in the list?

y Rajyalakshmi

Hi Alex,

1.I am using a Tab based form.(base_form)

created 4 panel(firstPanelClass,secondPanelClass,thirdPanelClass,fourthPanelClass)

added each panel to the same form(base_form) based on header Tabs.

Getting values from the secondPanelClass and  trying to updating the list in fourthPanel Class.

But the content in Tab is not updating.Even panel class is not refreshing. 

Only once in initializing every class is updating. for next time when we moved to another tab only scene transition is working(transitions are written in main_form). 

These classes are not refreshing.

2.Back event also leads to crashing.(written in base_form)
void
 base_form::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
{

    UiApp* pApp = UiApp::GetInstance();
        AppAssert(pApp);
        pApp->Terminate();



3. After crashing when we open again the app. those lists are updating.

 

Thanks

Rajyalakshmi

Alex Dem

Hi,
If you use Tab based app with Scene Manager (created from example) your every panel's class should contains  OnSceneActivatedN/OnSceneDeactivated methods which are called during transitions.  Hence you could update ListView there (to use UpdateList or RefreshList methods).
Alexey.

y Rajyalakshmi

Hi Alex,

I have tried  in debugger mode also. Even AppLog("OnSceneActivated") is not displying when scene is transitioned.

 

Thanks&Regards

Rajyalakshmi

Alex Dem

Hi ,
I just created tab based app with Scene Mamager from template and checked it. It works properly. Please check that you have added:
        pSceneManager->AddSceneEventListener(sceneId, *pPanel););
Alexey.

y Rajyalakshmi

Hi Alex,

please find the attched sample app. based on tabs.

In the first tab form i have created one EditField and one Button. on action performed  for Button  we are moving to second panel.

header focus is not updating. How to change that header focus.

In the second panel form same Button and one label i have created.

if we write some text on edit field and click on firstpanel. naviagtes to secondpanel and editfield text shows on the label.

It is working fine for the first time.but not for the second time.

please go through the link and give me clear idea about the scene updation for the sample tab app.

 

https://drive.google.com/?tab=mo&authuser=0#folders/0Byn7c6IvKc-mcS1QSG1VTHdYS3c

 

Thanks&Regards

Rajyalakshmi

Alex Dem

Hi
I looked your code:
To fix first problem please modify your code this way:
1) move pointer to form into every class declaration:
private:
    const Tizen::Ui::Controls::Form* __pForm;
....
2) in every tab class in method OnInitializing () please modify
__pForm = dynamic_cast<Form*>(GetParent()); and replace pForm with __pForm everywhere
3) in every tab class in method  OnSceneActivatedN()
please add similar code:
    Header* pHeader = __pForm->GetHeader();
    if(pHeader)
    {
        pHeader->SetItemSelected(0);// 1,2 tab indexes for another tabs
    }

Regarding second issue I ll try to provide good solution later.
Alexey.

Alex Dem

One more update:
You can do not use "OnSceneActivated()" method at all, here is example how to modify OnActionPerformed of every tab only, for example for tabTab1::OnActionPerformed(), just add this code to fix both issues:

//this code sets focus on "tab2" item of Header:
    Header* pHeader = __pForm->GetHeader();
    if(pHeader)
    {
        pHeader->SetItemSelected(1);
    }
//this code trying to find another panel and label on it and updates Label with EditField current value.

    Panel* panel2 = static_cast<Panel*>(__pForm->GetControl(L"IDC_PANEL2"));
    if (panel2)
    {
      Label* pLabel = static_cast<Label*>(panel2->GetControl(L"IDC_LABEL2"));
      if(pLabel && pEditField)
      {
         pLabel->SetText(pEditField->GetText());
      }
    }
but in described case your label will be updated only on Button1 click.

If you want update your label on any event please modify tabTab2::OnSceneActivatedN():

    Panel* panel = static_cast<Panel*>(__pForm->GetControl(L"IDC_PANEL1"));
    if(panel)
    {
      EditField* pEditText = static_cast<EditField*>(panel->GetControl(IDC_EDITFIELD1));
      if(pEditText)
      {
        plabel->SetText(pEditText->GetText());
       }
    }

p.s. it is not good way to create new tab1 object in tab2 class to extract EditField text only.
//tabTab1* tabObj= new tabTab1(); please remove it
Alexey.