This is an automated email from the ASF dual-hosted git repository.
carlosrovira pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/royale-docs.git
The following commit(s) were added to refs/heads/master by this push:
new 7cc6d01 add empty data binding and view states pages
7cc6d01 is described below
commit 7cc6d01efd9ca7e7cf09ff9d048efbfbd8a11298
Author: Carlos Rovira <[email protected]>
AuthorDate: Sat Aug 24 20:14:52 2019 +0200
add empty data binding and view states pages
---
_data/toc.json | 6 ++++++
create-an-application/application-tutorial/value-objects.md | 13 ++++++++-----
create-an-application/application-tutorial/view.md | 2 +-
welcome/features-and-concepts.md | 7 +++++++
{data-driven => welcome/features}/data-binding.md | 0
.../data-binding.md => welcome/features/view-states.md | 9 ++++++---
6 files changed, 28 insertions(+), 9 deletions(-)
diff --git a/_data/toc.json b/_data/toc.json
index 5be704e..d1be716 100644
--- a/_data/toc.json
+++ b/_data/toc.json
@@ -24,6 +24,12 @@
},
{
"path": "welcome/features/externs.md"
+ },
+ {
+ "path": "welcome/features/data-binding.md"
+ },
+ {
+ "path": "welcome/features/view-states.md"
}
]
},
diff --git a/create-an-application/application-tutorial/value-objects.md
b/create-an-application/application-tutorial/value-objects.md
index f6ed077..5a66888 100644
--- a/create-an-application/application-tutorial/value-objects.md
+++ b/create-an-application/application-tutorial/value-objects.md
@@ -16,10 +16,13 @@
layout: docpage
title: Value Objects
+description: Plain ActionScript Objects with properties or arrays
---
# Value Objects
+Plain ActionScript Objects with properties or arrays
+
Queries for data to many servers return JSON, which is a plain object or array
often referencing other plain objects and arrays. In ActionScript there are
advantages to using something called "data classes" or "value objects" (also
sometimes "ValueObjects").
Value Objects tell the compiler that your data has a fixed set of properties
of a given type. If you misspell the name of a field in the data, the compiler
will catch it. Some IDEs know how to complete the field name as you type it and
only offer completions for that data object instead of all strings used in the
file.
@@ -30,7 +33,7 @@ There is more than one way to create a Value Object for JSON
objects. This tutor
Many people prefer to keep their Value Objects in a separate folder/package.
For simplicity in this tutorial, we will just create the Value Object in the
main "src" folder. It will look like this:
-```
+```as3
package {
public class LogEntry
@@ -45,11 +48,11 @@ public class LogEntry
```
You can download this file from
[here](https://github.com/apache/royale-asjs/blob/develop/examples/express/GitHubCommitLogViewer/src/main/royale/LogEntry.as).
-Notice the use of [Bindable](data-driven/data-binding.html) metadata. This
special syntax indicates to the compiler that there are no DataBinding
notifications for the message field. Once it is set, it will not change. We
could also specify "message" as a "const" instead of a "var" and set up a
constructor with parameters, but constructor parameters are not allowed for
anything that wants to be declared in MXML.
+Notice the use of [Bindable](welcome/features/data-binding.html) metadata.
This special syntax indicates to the compiler that there are no DataBinding
notifications for the message field. Once it is set, it will not change. We
could also specify "message" as a "const" instead of a "var" and set up a
constructor with parameters, but constructor parameters are not allowed for
anything that wants to be declared in MXML.
Once we have the LogEntry Value Object, we use LogEntry throughout the app. In
the conversion loop, we change it to look like this:
-```
+```as3
for (var i:int = 0; i < n; i++)
{
var obj:Object = results[i];
@@ -64,7 +67,7 @@ Once we have the LogEntry Value Object, we use LogEntry
throughout the app. In t
In the data binding to the MultilineLabel, we must declare the type of the
object in the Array so that the compilers know that the message property is
from a LogEntry and should not be changed.
-```
+```mxml
<js:MultilineLabel text="{LogEntry(commits[dg.selectedIndex]).message}"
width="600" />
```
@@ -74,7 +77,7 @@ We could define more Value Objects like LogEntry for these
GitHub API data types
Another way to prevent the Google Closure Compiler from renaming variables is
to use bracket notation. To use the fewest bracket notations (because they are
prone to mispelling) we will refactor the code a bit (which should also make it
run a bit faster). Now the conversion loop looks like this:
-```
+```as3
for (var i:int = 0; i < n; i++)
{
var obj:Object = results[i];
diff --git a/create-an-application/application-tutorial/view.md
b/create-an-application/application-tutorial/view.md
index c831aa9..8bd6d2d 100644
--- a/create-an-application/application-tutorial/view.md
+++ b/create-an-application/application-tutorial/view.md
@@ -61,7 +61,7 @@ myLabel.text = projectName;
And we'd also have to write change detection code if the value could change at
runtime (which it doesn't in this case).
-See more about what this powerful feature can do for you on this page: [Data
binding](data-driven/data-binding.html).
+See more about what this powerful feature can do for you on this page: [Data
binding](welcome/features/data-binding.html).
Also, a commit message might be too long to read in a row of a DataGrid so we
will add a place to display the longer message of a selected commit.
diff --git a/welcome/features-and-concepts.md b/welcome/features-and-concepts.md
index eb449ca..b97ed38 100644
--- a/welcome/features-and-concepts.md
+++ b/welcome/features-and-concepts.md
@@ -43,3 +43,10 @@ Sometimes you may want your Royale application to call an
external piece of Java
Another option are externs, wich is uses [Google Closure Compiler
(GCC)](https://developers.google.com/closure/compiler/){:target='_blank'} to
declare that a name for a class, property or function is defined in external
code and so should not be renamed when application code is compiled. Apache
Royale can use the properties of the external library, and you can even see
them as options if you are using an __IDE__, with _code intelligence_ enabled.
[read about here](welcome/features/extern [...]
+## Data Binding
+
+[read about here](welcome/features/data-binding.html)
+
+## View States
+
+[read about here](welcome/features/view-states.html)
\ No newline at end of file
diff --git a/data-driven/data-binding.md b/welcome/features/data-binding.md
similarity index 100%
copy from data-driven/data-binding.md
copy to welcome/features/data-binding.md
diff --git a/data-driven/data-binding.md b/welcome/features/view-states.md
similarity index 91%
rename from data-driven/data-binding.md
rename to welcome/features/view-states.md
index b1a08f0..1800f98 100644
--- a/data-driven/data-binding.md
+++ b/welcome/features/view-states.md
@@ -15,7 +15,10 @@
# limitations under the License.
layout: docpage
-title: Data binding
+title: View States
+description: View States
---
-# Data binding
-*information coming soon.*
+
+# View States
+
+View States
\ No newline at end of file