mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
Update binding test pages.
This commit is contained in:
@ -208,8 +208,10 @@
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="apps\editable-text-demo\model.ts" />
|
||||
<TypeScriptCompile Include="apps\tests\weak-event-listener-tests.ts" />
|
||||
<TypeScriptCompile Include="apps\ui-tests-app\bindings\dbxmlbasics.ts" />
|
||||
<TypeScriptCompile Include="apps\ui-tests-app\bindings\dbbasics.ts" />
|
||||
<TypeScriptCompile Include="apps\ui-tests-app\bindings\xmlbasics.ts">
|
||||
<DependentUpon>xmlbasics.xml</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="apps\ui-tests-app\bindings\basics.ts" />
|
||||
<TypeScriptCompile Include="apps\ui-tests-app\layouts\absolute.ts" />
|
||||
<TypeScriptCompile Include="apps\ui-tests-app\layouts\dock.ts" />
|
||||
<TypeScriptCompile Include="apps\ui-tests-app\layouts\grid.ts" />
|
||||
@ -701,7 +703,7 @@
|
||||
<Content Include="apps\tests\xml-declaration\mymodulewithxml\my-control-no-js.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="apps\ui-tests-app\bindings\dbxmlbasics.xml" />
|
||||
<Content Include="apps\ui-tests-app\bindings\xmlbasics.xml" />
|
||||
<Content Include="apps\ui-tests-app\layouts\absolute.xml" />
|
||||
<Content Include="apps\ui-tests-app\layouts\dock.xml" />
|
||||
<Content Include="apps\ui-tests-app\layouts\grid.xml" />
|
||||
|
@ -6,7 +6,7 @@ export function alertTapped(args) {
|
||||
|
||||
export function alertWithOptionsTapped(args) {
|
||||
dialogs.alert({
|
||||
title: "Alert",
|
||||
title: "Alert Title",
|
||||
message: "Hi there!",
|
||||
okButtonText: "Close"
|
||||
});
|
||||
@ -18,7 +18,7 @@ export function confirmTapped(args) {
|
||||
|
||||
export function confirmWithOptionsTapped(args) {
|
||||
dialogs.confirm({
|
||||
title: "Confirm",
|
||||
title: "Confirm Title",
|
||||
message: "Are you sure?",
|
||||
okButtonText: "OK",
|
||||
cancelButtonText: "Cancel",
|
||||
@ -27,13 +27,13 @@ export function confirmWithOptionsTapped(args) {
|
||||
}
|
||||
|
||||
export function promptTapped(args) {
|
||||
dialogs.prompt("Enter name", "John Doe");
|
||||
dialogs.prompt("Enter name:", "John Doe");
|
||||
}
|
||||
|
||||
export function promptWithOptionsTapped(args) {
|
||||
dialogs.prompt({
|
||||
title: "Prompt",
|
||||
message: "Enter name",
|
||||
title: "Prompt Title",
|
||||
message: "Enter name:",
|
||||
okButtonText: "OK",
|
||||
cancelButtonText: "Cancel",
|
||||
neutralButtonText: "Ignore",
|
||||
@ -44,8 +44,8 @@ export function promptWithOptionsTapped(args) {
|
||||
|
||||
export function promptWithOptionsPasswordTapped(args) {
|
||||
dialogs.prompt({
|
||||
title: "Prompt",
|
||||
message: "Enter name",
|
||||
title: "Prompt Title",
|
||||
message: "Enter name:",
|
||||
okButtonText: "OK",
|
||||
cancelButtonText: "Cancel",
|
||||
neutralButtonText: "Ignore",
|
||||
@ -55,19 +55,18 @@ export function promptWithOptionsPasswordTapped(args) {
|
||||
}
|
||||
|
||||
export function loginTapped(args) {
|
||||
dialogs.login("Login:", "username", "pwd").then(r=> console.log(`Login result: ${r.result}, user: ${r.userName}, pwd: ${r.password}`));
|
||||
dialogs.login("Enter user/pass:", "username", "password").then(r=> console.log(`Login result: ${r.result}, user: ${r.userName}, pwd: ${r.password}`));
|
||||
}
|
||||
|
||||
export function loginWithOptionsTapped(args) {
|
||||
dialogs.login({
|
||||
title: "Login",
|
||||
message: "Enter user/pwd",
|
||||
title: "Login Title",
|
||||
message: "Enter user/pass:",
|
||||
okButtonText: "OK",
|
||||
cancelButtonText: "Cancel",
|
||||
neutralButtonText: "Ignore",
|
||||
defaultText: "John Doe",
|
||||
userName: "USER",
|
||||
password: "PWD"
|
||||
userName: "username",
|
||||
password: "password"
|
||||
}).then(r=> console.log(`Login result: ${r.result}, user: ${r.userName}, pwd: ${r.password}`));
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<Page>
|
||||
<ScrollView>
|
||||
<StackLayout>
|
||||
<Button text="alert" tap="alertTapped"/>
|
||||
<Button text="alert with options" tap="alertWithOptionsTapped"/>
|
||||
@ -13,4 +14,5 @@
|
||||
<Button text="action" tap="actionTapped"/>
|
||||
<Button text="action with options" tap="actionWithOptionsTapped"/>
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</Page>
|
@ -14,12 +14,21 @@ export function createPage() {
|
||||
var targetTwoWay = new textFieldModule.TextField();
|
||||
var buttonOneWay = new buttonModule.Button();
|
||||
var buttonTwoWay = new buttonModule.Button();
|
||||
var buttonSetText = new buttonModule.Button();
|
||||
|
||||
targetOneWay.id = "textFieldOneWay";
|
||||
targetTwoWay.id = "textFieldTwoWay";
|
||||
buttonOneWay.id = "buttonOneWay";
|
||||
buttonTwoWay.id = "buttonTwoWay";
|
||||
|
||||
buttonSetText.id = "buttonSetText";
|
||||
buttonSetText.text = "SetText";
|
||||
buttonSetText.on(buttonModule.Button.tapEvent, function () {
|
||||
targetOneWay.text = "Test";
|
||||
targetTwoWay.text = "Test";
|
||||
});
|
||||
stack.addChild(buttonSetText);
|
||||
|
||||
// OneWay Binding
|
||||
var bindingOptionOneWay = {
|
||||
sourceProperty: "textSource",
|
@ -1,8 +1,8 @@
|
||||
<Page>
|
||||
<StackLayout>
|
||||
<StackLayout loaded="stack0Loaded" orientation="horizontal">
|
||||
<TextField id="tf" text="{{ textSource }}" />
|
||||
<Button id="btn" />
|
||||
<TextField id="tf" text="{{ textSource }}" width="150" />
|
||||
<Button id="btn" width="150" />
|
||||
</StackLayout>
|
||||
<StackLayout loaded="stack1Loaded">
|
||||
<Label id="label" text="{{ text }}" />
|
Reference in New Issue
Block a user