Implementing Back Navigation Without TAU Library in Tizen Web Application

Original Created Sep 03, 2018 | Regeneration Apr 22, 2026

I'm developing a Tizen web application and need to implement back navigation functionality without using the entire TAU library due to UI compatibility issues. The standard window.history.back() method doesn't seem to work as expected.

I've tried using location.replace() but it's not efficient. Here's my current back.js implementation:

(function() {
    window.addEventListener('tizenhwkey', function(ev) {
        console.log('Back button pressed');
        if(ev.keyName === "back") {
            var activePopup = document.querySelector('.ui-popup-active'),
                page = document.getElementsByClassName('ui-page-active')[0],
                pageid = page ? page.id : "";
            
            screen.lockOrientation("portrait-primary");
            
            if(pageid === "mainpageList" && !activePopup) {
                try {
                    tizen.application.getCurrentApplication().exit();
                } catch (ignore) {
                }
            } else {
                window.history.back();
            }
        }
    });
})();

Is there a better way to implement back navigation without relying on TAU?

Problem Understanding

The user wants to implement back navigation functionality in a Tizen web application without using the full TAU library due to UI conflicts with other frameworks (like Bootstrap). The current implementation uses hardware key detection but seeks a more robust solution.

Solution Methods

  1. Partial TAU Usage: You can include only the necessary TAU components for back navigation while excluding UI-related parts.
  2. Custom History Management: Implement your own page history tracking system.
  3. Alternative Navigation Approach: Use a different method for page transitions while maintaining back functionality.

Code Examples

Option 1: Minimal TAU Implementation

<!-- Only include the navigation-related parts of TAU -->
<script src="/lib/tau/mobile/js/tau.min.js" data-tau-no-history="true"></script>

Option 2: Custom History Management

let pageHistory = [];

function navigateTo(pageId) {
    const currentPage = document.querySelector('.ui-page-active');
    if(currentPage) {
        pageHistory.push(currentPage.id);
    }
    // Your page transition logic here
}

function goBack() {
    if(pageHistory.length > 0) {
        const previousPageId = pageHistory.pop();
        // Transition to previous page
    } else {
        tizen.application.getCurrentApplication().exit();
    }
}

window.addEventListener('tizenhwkey', function(ev) {
    if(ev.keyName === "back") {
        goBack();
    }
});

Additional Tips

  • When mixing UI frameworks, be aware of potential CSS conflicts
  • Test your navigation thoroughly on actual Tizen devices
  • Consider using the Tizen Web Simulator for debugging navigation issues
  • For more information on Tizen navigation, refer to the official documentation at Samsung Tizen OS Developer Portal

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.