Re: [FlexJS] Issue with JSON.stringify and Bindable VO objects

2017-04-18 Thread Pan Li


Piotr

I am afraid the javascript can only act as a tool to implementation the
JSON class, it can't replace Flex JSON in whole, Since they are different.
If you use different thing as replacement it isn't hard to find cases
didn't cover
and the FlexJS's JSON in js has more issues than Bindable, I talked on it
only because it is the issue blocking me, also swf mode is broken as well.
Longer story:

the sdk document lists other difference: because the page is comparing Flex
SDK's JSON with broswer's javascript's JSON, there may be difference to our
case.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/JSON.html

A I had noticed JSON didn't work long before, but those days we didn't work
on SDK code, so I didn't dig deeper.
These were important issues which break my code:
A.1 JSON isn't supposed to output private properties, but current
implementation (using JS's as replacement) does
A.2 default date format of Flex SDK's JSON is different to FlexJS SDK's
A.3 when property of integer is not set, actionscript output it as 0 but
Javascript ignores it.
I think these is because JS's JSON doesn't have knowledge of ActionScript's
class system.

B These are issue which didn't affect my code but since you use this
approach as SDK implementation it is very critical:
B.1 If Actionscript class has other class as it property, it is supposed to
process it correctly, but in FlexJS's JSON (using JS's), it goes no where.
if the property's value in created inside the main domain, then FlexJS JS
mode doesn't process it but FlexJS swf mode does, otherwise FlexJS js mode
processes it but swf mode doesn't

C in today's testing mores unexpected behaviour is noticed:
C.1 the javascript JSON ignores any assignment on variables' declaration
(like  public var donothideme:uint = 88)

D There are some further issues if you use javascript code as the FlexJS
SDK implementation
D.1 it can't handle actionscripts's property name with get/set correctly,
an extra underscore is added.
D.2 the code will ignore an user declared property named _target, it is not
rare to have a property named "_target" in VO objects

these are domain classes which can reproduce some of issues listed above,
you need to run in in Flex, FlexJS swf mode and FlexJS js mode to compare:



package
{

public class Book
{
public function Book()
{
}

public var title: String;
public var page : uint;
public var date : Date;
public var authors : Array;
public var topic : Topic = new Topic();


public var donothide: uint = 99;
private var internalDate: Date = new Date();



}
}

package
{

public class Topic
{
public function Topic()
{
}

public var name: String = "Politics";


}
}




Code to create testing instance:

var book : Book = new Book();
book.title = "Trump";
book.date = new Date();
book.authors = new Array();
book.authors.push("Kitten");
book.authors.push("Puppy");





My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.

Re: [FlexJS] Switching SDK from 0.7 to 0.8(dev) and rebuild FlexJS project without cleaning will cause runtime error in js mode

2017-01-12 Thread Pan Li


Yes Josh
it is about FlexJS app using the nightly build.


My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.

[FlexJS] Switching SDK from 0.7 to 0.8(dev) and rebuild FlexJS project without cleaning will cause runtime error in js mode

2017-01-11 Thread Pan Li


I had reported this issue earlier, when I reported it last time I thought
it was compiler bug.
It isn't really a bug but I think it is better to report anyway.

To reproduce the problem:
1 Take any project which can work in both 0.7 and 0.8
build it with 0.7
2 Using 0.8(dev) to build and run it in js mode
there will be js runtime error:

TypeError: views.MyInitialView.superClass_.get__MXMLDescriptor is undefined
[Learn More]  MyInitialView.js:651:15
.MXMLDescriptor.get
file:///Users/lipan/Downloads/testbmmljan09/bin/js-debug/views/MyInitialView.js:651:15
org.apache.flex.core.ContainerBase.prototype.addedToParent
file:///Users/lipan/Downloads/testbmmljan09/bin/js-debug/org/apache/flex/core/ContainerBase.js:173:5
org.apache.flex.core.Application.prototype.addElement
file:///Users/lipan/Downloads/testbmmljan09/bin/js-debug/org/apache/flex/core/Application.js:115:3
org.apache.flex.core.Application.prototype.initialize
file:///Users/lipan/Downloads/testbmmljan09/bin/js-debug/org/apache/flex/core/Application.js:265:3
org.apache.flex.core.Application.prototype.start
file:///Users/lipan/Downloads/testbmmljan09/bin/js-debug/org/apache/flex/core/Application.js:236:5

file:///Users/lipan/Downloads/testbmmljan09/bin/js-debug/index.html:188:3


The fix is simple, if you clean the project before build again it will
work.



My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.

Re: [FlexJS] last git code doesn't work as of 2016 NOV 29,

2016-12-02 Thread Pan Li


Hi Alex
I think the javascript runtime issues happened to us again, I don't have
more time to test it fully now, but it seems to happen when I didn't
removed old files before rebuilding. I didn't see this in 0.7.
I will test more later and send you my result if I find something.


My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.

Re: [FlexJS] last git code doesn't work as of 2016 NOV 29

2016-12-01 Thread Pan Li


Hi Alex
When I tested version I got about NOV 28 (which was last build success
around 27), it failed to run app when wen have code like


http://ns.adobe.com/mxml/2009;  xmlns:local="*"
xmlns:js="library://ns.apache.org/flexjs/basic"
xmlns:ns="library://ns.apache.org/flexjs/html5">

...

I just run test again but could not reproduce the problem, but the source
code we are using is more updated



My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.

Re: [FlexJS] last git code doesn't work as of 2016 NOV 29

2016-11-29 Thread Pan Li


Alex thanks for your help, I can get the databinding samples in SDK working
now
the problem was  is broken in 0.8. Our samples were using
it. I had removed fx:Declarations and it works as well.


Thank you
Pan Li

My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.

[FlexJS] last git code doesn't work as of 2016 NOV 29

2016-11-28 Thread Pan Li



Hi
we would like to try 0.8 for our application, but we could not get the last
git code building correct, the produced SDK can build FlexJS application
but the app fail with runtime javascript error.

I checked nightly builds at
http://apacheflexbuild.cloudapp.net:8080/job/flex-asjs/

I download the last successful nightly build (of Nov 28) and install it, it
can build FlexJS application but the app fails with the same runtime
javascript error
TypeError: undefined is not an object (evaluating
'NewFlexJSBrowserProject2.superClass_.get__MXMLDescriptor.apply')

Could some one guide me to get working binary or source code of 0.8?




Thank you
Pan Li

My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.

[FlexJS] click event of Label is not working in javascript mode

2016-11-11 Thread Pan Li


Hi, I tested in code in FlexJS 0.7:


In swf mode, clicking Label "Hit here to test" will change text of
"debugLabel", but the same code has no effect in javascript mode



In 0.6 it works both in swf and javascript




My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.

[FlexJS] Container.numElements is not working

2016-11-03 Thread Pan Li


platform: Mac OS 10.4; FlexJS 0.7

numElements of the UI element Container doesn't work, it can be reproduced
by this code snippet:











Run it in FlexJS0.7 in javascript or awf mode, it will show "1", but
expected value is 4.

Similar code in Flex works as expected:








I also noted the api list of FlexJS's Container is much shorter than Flex's
Container, does this mean Container of FlexJS is not fully finished?


Thanks
Pan LI


My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.

Is reflection supported? More general, how could I tell if one feature is supported?

2016-10-14 Thread Pan Li


Hi guys
We are working on one FlexJS application, it looks like the refection utils
in Flex are all missing in last FlexJS. We had switched to other approach
so we don't need it right now. but here are my questions:
1 The last api document doesn't have classes of refection utils, but some
other Flex classes are also not existing. Can I assume they are
unsupported? But the api document is also missing some top level classes.
Is there some rule to define which class should be included in api
document? It may be very obvious to advanced FlexJS users, but it is very
confusing to anyone new to FlexJS.

2 Is there plan to support reflection later?

3 More importantly, how could I know if one feature is fully support in
last FlexJS without writing test code? Is there some over all document of
what is supported? Again it should be very obvious to advanced FlexJS
users, but to us new to FlexJS, one simple feature list can literally save
weeks of work.


My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.

Re: [FlexJS] 'new int()' causes problem in FlexJS 0.7

2016-10-13 Thread Pan Li


Hi Alex
there is no reason to use "new". I am asking this because we have old Flex
code to migrate to FlexJS, and I noticed a difference


My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.

[FlexJS] 'new int()' causes problem in FlexJS 0.7

2016-10-13 Thread Pan Li


this line works in Flex application as expected
test = new int("123")

but it doesn't work in FlexJS 0.7, it does build but the created javascript
fails with javascript error:
Can't find variable: int


on the other hand, this does work:
test = new Number("123")


Thank you
Pan Li
http://Prominic.NET  | Skype: PanProminic
pa...@prominic.net
cellphone: +86-1860152

My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.

Re: [FlexJS]databinding using 'curly braces {} syntax' is broken in 0.7

2016-10-13 Thread Pan Li


Greg: thank you

Olaf: can you please give me a sample or link or document describing what
is proper binding bead of the curly brace data binding? There is no samples
in SDK using this syntax, we had tried lots of code but it didn't work, we
are not sure if we did it correctly




Thank you

My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.

Re: [FlexJS]databinding using 'curly braces {} syntax' is broken in 0.7

2016-10-12 Thread pan Li
yes the sample I post was wrong
Thank you for point out



--
View this message in context: 
http://apache-flex-development.247.n4.nabble.com/FlexJS-databinding-using-curly-braces-syntax-is-broken-in-0-7-tp55708p55725.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.


[FlexJS]databinding using 'curly braces {} syntax' is broken in 0.7

2016-10-12 Thread Pan Li


FlexJS comes with samples using databinding, but basic 'curly brace syntax'
is broken.
these two lines can reproduce the problem:




the code works as expect in Flex application, but it doesn't set text to
the Label in FlexJS 0.7 or 0.6


Thank you

Pan Li
My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.

[FlexJS]DateField control is broken

2016-10-11 Thread Pan Li


 DateField is not working in FlexJS 0.7

it pops error when starting in awf mode
it does show in javascript mode but it doesn't response mouse click:






Thank you

Pan Li

My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.

[FlexJS]variable's default access control is not complied correctly in javascript mode

2016-10-10 Thread Pan Li


Actionscript document defines that internal (default) variable means: (the
variable is )Visible to references inside the same package.

But it doesn't compile correctly in FlexJS javascript mode in 0.7 and 0.6,
it does build but the created javascript is broken:
here is one simple class to reproduce the probelm:
package
{
public class SomeClass
{
 var field:String = "hello";
 public function doSomething():String
 {
 return field;
 }
}
}

the code runs perfectly in Flex and runs perfectly in FlexJS awf mode, but
in javascript mode the created javascript looks like:

/**
 * @export
 * @type {string}
 */
SomeClass.prototype.field = "hello";


/**
 * @export
 * @return {string}
 */
SomeClass.prototype.doSomething = function() {
  return field;
};
above code fails in javascript


If I use private or any other access control keyword:
package
{
public class SomeClass
{
 private var field:String = "hello";
 public function doSomething():String
 {
 return field;
 }
}
}

the produced javascript is:

/**
 * @private
 * @type {string}
 */
SomeClass.prototype.field = "hello";


/**
 * @export
 * @return {string}
 */
SomeClass.prototype.doSomething = function() {
return this.field;
};



We had lots of existing Flex code which will be migrated to FlexJS, the
default access control is used everywhere. If FlexJS changes syntax of
actionscript, then there should be a document listing the difference, if
syntax is not changed, then this is a bug needs to be fixed


Thank you
Pan Li
My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.

[FlexJS] DateChooser in FlexJS 0.7 fails in swf mode, doesn't render correctly in javascript mode

2016-10-08 Thread Pan Li


Hi everyone!

DateChooser control fails to me in FlexJS 0.7 in swf mode:
the problem can be reproduced with only two lines of code (There were
longer code but I removed not relevant codes to demonstrate the problem I
have)
-



-

it pops error when starting the application in swf mode:
TypeError: Error #1007: Instantiation attempted on a non-constructor.
at org.apache.flex.html.beads::DateChooserView/set strand()[c:\Jenkins
\workspace\flex-asjs\frameworks\projects\HTML\src\main\flex\org\apache\flex
\html\beads\DateChooserView.as:71]
at org.apache.flex.core::UIBase/addBead()[c:\Jenkins\workspace
\flex-asjs\frameworks\projects\Core\src\main\flex\org\apache\flex\core
\UIBase.as:1028]
at org.apache.flex.core::UIBase/addedToParent()[c:\Jenkins\workspace
\flex-asjs\frameworks\projects\Core\src\main\flex\org\apache\flex\core
\UIBase.as:1319]
at org.apache.flex.core::UIBase/addElement()[c:\Jenkins\workspace
\flex-asjs\frameworks\projects\Core\src\main\flex\org\apache\flex\core
\UIBase.as:1093]
... (many others)


the exactly same code can start in javascript mode of FlexJS, but the date
chooser doesn't render perfectly, there are some random gaps between some
of the cells of "day".

I had seen similar issues in earlier FlexJS 0.6 using DateChooser control.



Thank you

Pan Li
My Apache Flex community contribution is working on the open source
Moonshine-IDE.com for FlexJS.