언어 설정

Menu
Sites
Language
Problems with tau
 

Hello to this community,

currently I'm trying to write my first tizen web app and I run into problems with tau on a regular basis. Maybe one of you guys can help me.

Earlier I got weird behaviour when I had jquery imported so that i choose to not use it anymore. I used the following code to import it though:

<head>
    

	<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
	<title>test</title>
	<link rel="stylesheet" href="lib/tau/wearable/theme/default/tau.min.css">
	<link rel="stylesheet" media="all and (-tizen-geometric-shape: circle)" href="lib/tau/wearable/theme/default/tau.circle.min.css">
	<!-- load theme file for your application -->
	<link rel="stylesheet" href="css/style.css">
	
	
	
<!-- 	<script src="lib/jquery-2.1.4.js"></script> -->
<!-- 	<script src="lib/jquery-1.11.3.js"></script> -->
<!-- 	<script src="lib/jquery.mobile-1.4.5.js"></script> -->
	
	<script src="lib/tau/wearable/js/tau.js"></script>
	

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

	<script src="js/circle-helper.js"></script>	
	<script src="lowBatteryCheck.js"></script>
</head>

 

Right now I have the problem that the popup I'm creating is not closing when I press the button. I used the following to create it:

    <div id="popupMainOK" class="ui-popup">
		<div class="ui-popup-content" id="popupMainOK-text">msg</div>
		<div class="ui-popup-footer ui-bottom-button">
			<a id="1btnPopup-cancel" href="#" class="ui-btn ui-btn-icon-only btn-icon-check" data-rel="back">Check</a>
		</div>
	</div>	

 

and in app.js I have a init() function which is called on pageload which has the following code:

var popupWidget = tau.openPopup("#popupMainOK");
		 
document.getElementById('popupMainOK').addEventListener("popuphide", onPopupPressBtnHide);
 

I tried so many different things but nothing worked properly so far. How am I supposed to use this?  I copied my tau library and stylesheets and stuff from the webui sample and im using the tizen 2.4 SDK with the wearable 2.3.1 downloaded via the updatemanager. According to the version file I'm using tau version 0.11.4.

I also get the same result when I use the code given in the SDK help

https://developer.tizen.org/dev-guide/2.3.1/org.tizen.web.apireference/html/ui_fw_api/mobile/ns_widget_mobile_Popup.htm)
var popupElement = document.getElementById("popupMainOK"),
           popup = tau.widget.Popup(popupElement);
popup.open();

document.getElementById('popupMainOK').addEventListener("popuphide", onPopupPressBtnHide);

I appretiate any help as I'm lost here.

I'm also thankfull for any tips on which help files to use or which development steps to take or tools to use...

 

greetings

daberne

Responses

2 댓글
Seoghyun Kang

Hello,

 

When I wathed your code, I did not find problem.

But.. Because it is not full code, I could not launch it.

 

If you register the full code, I will check it.

 

By the way....  I remember that I receive the similiar question before.

It was the timing issue. When does "init method" call?

 

Please check the timing.

 

Thanks.

Heeju Joo

Hello, 

Did you put popup in page? for example,

<div class="ui-page ui-page-active" id="main">
	<header class="ui-header">
		<h2 class="ui-title">Example</h2>
	</header>
	<div class="ui-content content-padding">
		<a id="openpopup" class="ui-btn">Open!</a>
	</div>
	<div id="1btnPopup" class="ui-popup">
		<div class="ui-popup-content">
    		Turning on Power
    		saving mode will
    		limit the maximum
    		power.
		</div>
		<div class="ui-popup-footer ui-bottom-button">
		    <a id="1btnPopup-cancel" href="#" class="ui-btn" data-rel="back">Check</a>
		</div>
	</div>
</div>

And  in your app.js, please bind eventhandler when "pagebeforeshow" or "pageshow" triggered.

For example,

(function(tau) {
    var page,
		button;

	document.addEventListener("pagebeforeshow", function (e) {
		page = e.target;
		button = page.querySelector("#openpopup");
	
		button.addEventListener("click", function() {
			tau.openPopup("#1btnPopup");
		});
	});
}(tau));

I run in emulator with above sample code and checked it runs well :) (open popup and close popup both)

 

Thank you.