语言

Menu
Sites
Language
Change Text of entry in multi view app

Hello, first of all I just started devolping tizen

I build an app with three views with the UI builder. There is manged code I can't modify.

On one view i have two entry for showing information. Now I want to change the text in these entrys in View 2 when the user click the button in View 3.

I tried, with different methods but nothing worked.

I can read the text out of the  object but not set.

 

Here some code I tried

void vTimeSet_btnTimeBack_onpressed(uib_vTimeSet_view_context *vc, Evas_Object *obj, void *event_info) {
    //Invoked at the start of wrapper function vTimeSet_connection_vTimeSet_btnTimeBack_onpressed
    //Invoked at the start of wrapper function vTimeSet_connection_vTimeSet_btnTimeBack_onpressed

    uib_app_manager_st* uib_app_manager = uib_app_manager_get_instance();
    uib_vEinstellungen_view_context* vE = (uib_vEinstellungen_view_context*)uib_app_manager->find_view_context("vEinstellungen");
   

    const char *s = elm_entry_entry_get(vE->enSettingsStart); // read the text is working

    //vE->is_user_view = true; // change the user view doesn'T help

    if (bStart) {
        //entry = vE->enSettingsStart;
        elm_object_text_set(&vE->enSettingsStart, "Juhu"); // set the text does not work
        evas_object_show(vE->enSettingsStart);
        //elm_object_text_set(vE->enSettingsStart, "Start");
    } else {
        //entry = vE->enSettingsStop;
        elm_object_text_set(vE->enSettingsStop, "Stop");
        evas_object_show(vE->enSettingsStop);
    }
    Elm_Object_Item* navi_item = uib_util_push_view("vEinstellungen");

    elm_object_text_set(vE->enSettingsStart, "Juhu");
    evas_object_show(vE->enSettingsStart);
    evas_object_show(vE->view_name);
    s = elm_entry_entry_get(vE->enSettingsStart);
    //vTimeSet_btnTimeBack_onpressed_post(navi_item, vc, obj, event_info);

}

Help would be great!


 

响应

4 回复
GEUNSOO KIM

looks like this line has a typo or wrong usage

 elm_object_text_set(&vE->enSettingsStart, "Juhu"); // set the text does not work

the line should be used like this.

=>  elm_object_text_set(vE->enSettingsStart, "Juhu"); // set the text does not work

good luck.

Anton Trautmann

Thanks for the answer,

but this is not the solution.

As you see in the last lines I tried this too.

But to your information, when I read the

s = elm_entry_entry_get(vE->enSettingsStart);

in the last line the text is changed but on the view the old value stays.

When the event starts new the old value appears again.

So the change of the value is not changed in the entry object.

So what...

dev madrad

Try

evas_object_text_set()

.

And for future, use "add code" to post code snippets.

 

BR

Anton Trautmann

Got the reason for the behaviour,

I have three views, and every time you change from one to the next, the view will be created new. So the changes to all of the objects inside come to the initial values.

Is there a possibilty to avoid this or must I change the values every time?

Like I do now on the view create event.