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