Changing Entry Text in a Multi-View Tizen Application

Original Created Jan 08, 2018 | Regeneration Apr 22, 2026

I'm new to Tizen development and have created an application with three views using the UI Builder. The application contains managed code that I cannot modify.

In View 2, I have two entry fields displaying information. I need to change the text in these entries when a button in View 3 is clicked. While I can successfully read the text from these entries, I'm unable to set new text values.

I've tried several methods without success. Here's some of the code I attempted:

void vTimeSet_btnTimeBack_onpressed(uib_vTimeSet_view_context *vc, Evas_Object *obj, void *event_info) {
    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); // Reading text works
    
    if (bStart) {
        elm_object_text_set(&vE->enSettingsStart, "Juhu"); // Setting text doesn't work
        evas_object_show(vE->enSettingsStart);
    } else {
        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);
}

The text appears to change when I read it back, but the view continues to display the old value. When the event triggers again, the old value reappears, suggesting the change isn't being persisted in the entry object.

Problem Understanding

The core issue involves:

  1. Text changes not persisting in entry fields across view transitions
  2. Views being recreated each time they're accessed, resetting all values
  3. Difficulty in modifying entry text from a different view

Solution Methods

  1. Correct API Usage:

    • Remove the incorrect & operator when calling elm_object_text_set()
    • Use elm_entry_entry_set() instead of elm_object_text_set() for entry widgets
  2. Persistent Data Storage:

    • Store the modified text values in a persistent location (like app data or global variables)
    • Update the entry fields each time the view is created
  3. View Management:

    • Avoid recreating views unnecessarily
    • Consider using a single view with dynamic content changes instead of multiple views

Code Examples

// Correct way to set entry text
elm_entry_entry_set(vE->enSettingsStart, "New Text");

// Persistent storage example
static char *persistentText = NULL;

void button_clicked_cb() {
    persistentText = strdup("New Persistent Text");
    // Navigate to view
}

void view_create_cb() {
    if (persistentText) {
        elm_entry_entry_set(vE->enSettingsStart, persistentText);
    }
}

Additional Tips

  • Use the Tizen application data storage APIs for more robust persistence
  • Consider using signals or callbacks to communicate between views
  • Verify view lifecycle management in your application
  • For complex UI interactions, consider using the EFL Elementary API more extensively

Customize your cookie preferences

You can enable or disable non-essential cookies. Essential cookies are always on to ensure the site works properly and to keep you signed in.

Necessary

These cookies are necessary for the website to function properly and cannot be switched off. They help with things like logging in and setting your privacy preferences.

Always on

Analytics

These cookies help us improve the site by tracking which pages are most popular and how visitors move around the site.

Enable analytics cookies
Public Forum Public Forum
Employees only. Please sign in with your company account.