언어 설정

Menu
Sites
Language
HW key event is not work after history back

There are event handler and link like as below.

 

1. index.html

document.addEventListener('tizenhwkey', function(e) {
  if(e.keyName == "back"){
     tizen.application.getCurrentApplication().exit();
  }
});

window.open("new_window.html, "_self");

 

2. new_window.html

document.addEventListener('tizenhwkey', function(e) {
  if(e.keyName == "back"){
     history.back();
  }
});

 

I opened new HTML page using "window.open" and go back to index.html when back key event fired.

But back key event is not fired on "index.html"

 

How can I fix this issue?

Responses

7 댓글
Lakshmi Grandhi

Hi,

This is known issue, it will be fixed in next tizen release

 

WONCHUL SHIN

Thank you for your response.

I have one more question.

Window event is not fired also. Is this same as HW key event?

I have added "onpagesshow" event. but it was not working also.

 

document.body.addEventListener("onpageshow", eventcall(), false);

 

Thank you in advance.

Lakshmi Grandhi

i have tested  onpageshow event it is working. can you share your code how you have tested it

 

WONCHUL SHIN

 - handler.js

document.body.addEventListener("onpageshow", eventcall(), false);

function eventcall(){

  alert("event!!");

}

 

- index.html

<script src="handler.js"></script>

<script>

window.open("new_window.html", "_self");

</script>

 

- new_window.html

<script src="handler.js"></script>

<body><input type ="button" onClick="history.back()">Go back</input></body>

 

- Result

1. event!! message is shown on "index.html"

2. "new_window.html" page opened

3. event!! message is shown on "new_window.html"

4. Go back to "index.html"

5. event!! message is not shown.

-> I want to know why it does not called on "index.html".

Thank you.

 

fahad khatib

Hello all,

I also face same problem in 2.2. Is there anyone having solution of this problem.

Thanks in advance.

Marco Buettner

I dont know if the problem was fixed in 2.3... I haven't test it yet... But for 2.2 you have no solution for that.

AVSukhov

Hello,

Try to use:

if (window.history.length != 0) 

window.history.back() 

if (window.history.length == 0) 

var pw=window.parent;pw.opener=window.self;pw.close()