You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@royale.apache.org by Olaf Krueger <ma...@olafkrueger.net> on 2017/12/25 22:42:16 UTC

Need help with states

Hi,
I am trying to change the text of a TextButton by using states [1] but the
text of the button is always empty.
I've tried several things but nothing works for me.
It seems to me that that the value of currentState is set correctly, but it
doesn't have any effect on the properties of the components?

Thanks,
Olaf

[1] https://gist.github.com/ok-at-github/f521e91fe95bf5b3b03eddcc48e87f40



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Need help with states

Posted by Harbs <ha...@gmail.com>.
My bad. I searched asjs and I had my settings to only search .as files…

Harbs

> On Dec 26, 2017, at 10:09 AM, Alex Harui <ah...@adobe.com> wrote:
> 
> Which component list?  It looks like it is in the basic-manifest in Core.swc.
> 
> -Alex
> 
> From: Harbs <harbs.lists@gmail.com <ma...@gmail.com>>
> Reply-To: "users@royale.apache.org <ma...@royale.apache.org>" <users@royale.apache.org <ma...@royale.apache.org>>
> Date: Monday, December 25, 2017 at 11:46 PM
> To: "users@royale.apache.org <ma...@royale.apache.org>" <users@royale.apache.org <ma...@royale.apache.org>>
> Subject: Re: Need help with states
> 
> I think you should also be able to just include SimpleStatesImpl in the list of <beads>.
> 
> But it looks like it’s missing from the component list, so it can’t be normally declared in MXML. I assume this is an oversight and should be fixed.
> 
> Harbs
> 
>> On Dec 26, 2017, at 1:10 AM, Piotr Zarzycki <piotrzarzycki21@gmail.com <ma...@gmail.com>> wrote:
>> 
>> Hi Olaf,
>> 
>> You are missing bead SimpleStatesImpl, which need to be added in the following way [1]
>> 
>> 
>> [1]
>> https://paste.apache.org/C6GW <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpaste.apache.org%2FC6GW&data=02%7C01%7Caharui%40adobe.com%7C2c7d0232aedf491d100f08d54c34cc3f%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636498712003523982&sdata=hFOITyiNx4tqTrq0thFfF2qSaZ3v9gn172Q5iay56ls%3D&reserved=0>
>> 
>> 
>> Thanks, Piotr :)
>> 
>> 
>> 
>> 2017-12-25 23:42 GMT+01:00 Olaf Krueger <mail@olafkrueger.net <ma...@olafkrueger.net>>:
>>> Hi,
>>> I am trying to change the text of a TextButton by using states [1] but the
>>> text of the button is always empty.
>>> I've tried several things but nothing works for me.
>>> It seems to me that that the value of currentState is set correctly, but it
>>> doesn't have any effect on the properties of the components?
>>> 
>>> Thanks,
>>> Olaf
>>> 
>>> [1] https://gist.github.com/ok-at-github/f521e91fe95bf5b3b03eddcc48e87f40 <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgist.github.com%2Fok-at-github%2Ff521e91fe95bf5b3b03eddcc48e87f40&data=02%7C01%7Caharui%40adobe.com%7C2c7d0232aedf491d100f08d54c34cc3f%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636498712003523982&sdata=A4q30fDs6JBgZpNKXPBxBGVe%2FK4yxv5qj%2BWxQbbFOms%3D&reserved=0>
>>> 
>>> 
>>> 
>>> --
>>> Sent from: http://apache-royale-users.20374.n8.nabble.com/ <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-royale-users.20374.n8.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7C2c7d0232aedf491d100f08d54c34cc3f%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636498712003523982&sdata=N3Slx%2BXAcSqInVDNEO0Zig0Tlxip8TdfOP%2FSo1Nhc4g%3D&reserved=0>
>> 
>> 
>> 
>> -- 
>> Piotr Zarzycki 
>> 
>> Patreon: https://www.patreon.com/piotrzarzycki <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com%7C2c7d0232aedf491d100f08d54c34cc3f%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636498712003523982&sdata=YrmY9W6UpmDAOkEkTtTDC8NfCfjKozLD3XiJ%2F3Gv0AA%3D&reserved=0>


Re: Need help with states

Posted by Alex Harui <ah...@adobe.com>.
Which component list?  It looks like it is in the basic-manifest in Core.swc.

-Alex

From: Harbs <ha...@gmail.com>>
Reply-To: "users@royale.apache.org<ma...@royale.apache.org>" <us...@royale.apache.org>>
Date: Monday, December 25, 2017 at 11:46 PM
To: "users@royale.apache.org<ma...@royale.apache.org>" <us...@royale.apache.org>>
Subject: Re: Need help with states

I think you should also be able to just include SimpleStatesImpl in the list of <beads>.

But it looks like it’s missing from the component list, so it can’t be normally declared in MXML. I assume this is an oversight and should be fixed.

Harbs

On Dec 26, 2017, at 1:10 AM, Piotr Zarzycki <pi...@gmail.com>> wrote:

Hi Olaf,

You are missing bead SimpleStatesImpl, which need to be added in the following way [1]

[1] https://paste.apache.org/C6GW<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpaste.apache.org%2FC6GW&data=02%7C01%7Caharui%40adobe.com%7C2c7d0232aedf491d100f08d54c34cc3f%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636498712003523982&sdata=hFOITyiNx4tqTrq0thFfF2qSaZ3v9gn172Q5iay56ls%3D&reserved=0>

Thanks, Piotr :)


2017-12-25 23:42 GMT+01:00 Olaf Krueger <ma...@olafkrueger.net>>:
Hi,
I am trying to change the text of a TextButton by using states [1] but the
text of the button is always empty.
I've tried several things but nothing works for me.
It seems to me that that the value of currentState is set correctly, but it
doesn't have any effect on the properties of the components?

Thanks,
Olaf

[1] https://gist.github.com/ok-at-github/f521e91fe95bf5b3b03eddcc48e87f40<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgist.github.com%2Fok-at-github%2Ff521e91fe95bf5b3b03eddcc48e87f40&data=02%7C01%7Caharui%40adobe.com%7C2c7d0232aedf491d100f08d54c34cc3f%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636498712003523982&sdata=A4q30fDs6JBgZpNKXPBxBGVe%2FK4yxv5qj%2BWxQbbFOms%3D&reserved=0>



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-royale-users.20374.n8.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7C2c7d0232aedf491d100f08d54c34cc3f%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636498712003523982&sdata=N3Slx%2BXAcSqInVDNEO0Zig0Tlxip8TdfOP%2FSo1Nhc4g%3D&reserved=0>



--

Piotr Zarzycki

Patreon: https://www.patreon.com/piotrzarzycki<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%7Caharui%40adobe.com%7C2c7d0232aedf491d100f08d54c34cc3f%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636498712003523982&sdata=YrmY9W6UpmDAOkEkTtTDC8NfCfjKozLD3XiJ%2F3Gv0AA%3D&reserved=0>


Re: Need help with states

Posted by Harbs <ha...@gmail.com>.
I think you should also be able to just include SimpleStatesImpl in the list of <beads>.

But it looks like it’s missing from the component list, so it can’t be normally declared in MXML. I assume this is an oversight and should be fixed.

Harbs

> On Dec 26, 2017, at 1:10 AM, Piotr Zarzycki <pi...@gmail.com> wrote:
> 
> Hi Olaf,
> 
> You are missing bead SimpleStatesImpl, which need to be added in the following way [1]
> 
> [1] https://paste.apache.org/C6GW <https://paste.apache.org/C6GW>
> 
> Thanks, Piotr :)
> 
> 
> 2017-12-25 23:42 GMT+01:00 Olaf Krueger <mail@olafkrueger.net <ma...@olafkrueger.net>>:
> Hi,
> I am trying to change the text of a TextButton by using states [1] but the
> text of the button is always empty.
> I've tried several things but nothing works for me.
> It seems to me that that the value of currentState is set correctly, but it
> doesn't have any effect on the properties of the components?
> 
> Thanks,
> Olaf
> 
> [1] https://gist.github.com/ok-at-github/f521e91fe95bf5b3b03eddcc48e87f40 <https://gist.github.com/ok-at-github/f521e91fe95bf5b3b03eddcc48e87f40>
> 
> 
> 
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/ <http://apache-royale-users.20374.n8.nabble.com/>
> 
> 
> 
> -- 
> Piotr Zarzycki 
> 
> Patreon: https://www.patreon.com/piotrzarzycki <https://www.patreon.com/piotrzarzycki>

Re: Need help with states

Posted by Olaf Krueger <ma...@olafkrueger.net>.
>you will definitely see everything what you need there when you type
"state". :) 

Sounds great!! :-)

Olaf



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Need help with states

Posted by Piotr Zarzycki <pi...@gmail.com>.
Olaf,

Thanks for the information. Today I have spent on that some time and just
make code completion more intelligent. In January we will release Moonshine
1.8.0 and you will definitely see everything what you need there when you
type "state". :)

Thanks, Piotr


2017-12-27 21:55 GMT+01:00 Olaf Krueger <ma...@olafkrueger.net>:

> >Cause code completion should show also those items which has words in the
> middle of sentence. Let me know.
>
> Yes, I am currently using Moonshine. Maybe I am doing something wrong but
> for me, code completion finds only items that matches e.g this pattern
> 'state*' (from the beginning of the item name).
>
> Thanks,
> Olaf
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>



-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
<https://www.patreon.com/piotrzarzycki>*

Re: Need help with states

Posted by Olaf Krueger <ma...@olafkrueger.net>.
>Cause code completion should show also those items which has words in the
middle of sentence. Let me know.

Yes, I am currently using Moonshine. Maybe I am doing something wrong but
for me, code completion finds only items that matches e.g this pattern
'state*' (from the beginning of the item name).

Thanks,
Olaf



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Need help with states

Posted by Piotr Zarzycki <pi...@gmail.com>.
Olaf,

Comments inline.

[1]
https://github.com/apache/royale-asjs/blob/develop/examples/royale/RoyaleStore/src/main/royale/main.css

Thanks, Piotr

2017-12-26 19:39 GMT+01:00 Olaf Krueger <ma...@olafkrueger.net>:

> Hi guys,
> the MXML and also the fx:style way works for me.
>
> Before asking here I've already thought about a missing bead and so I tried
> different ways to find out the name of the bead:
> IDEs CodeCompletion doesn't work cause the bead name doesn't start with
> "State*".
>

If you were using Moonshine it look like there is a room for some
improvements. Cause code completion should show also those items which has
words in the middle of sentence. Let me know.


> Then I searched the asjs repo but the github search isn't very helpful
> here.
> Then I walked through the examples in order to find an example that makes
> use of states.  I found e.g. this [1], but because I didn't found a states
> related bead that 'enables the states feature' I finally thought such a
> bead
> is maybe not needed (against PAYG).
>
So a few questions are left:
> 1)
> Maybe I am blind but could somebody point me to the piece of code in this
> example [1] which 'enables the states feature'. Is it baked-in within other
> beads or components?
>
>
Declaration of css for example [1] is being done in css style. [1] The
difference is that in my example which I have provide you I have put
declaration in the Main application file, in example [1] it is in separate
file.



> 2)
> I don't understand Piotr's code snippet [2]
> Why does it work? And what is the relation between styles and states?
>

There is no relations, it is just the way of adding beads. As Harbs said in
the previous post you could add to your view state bead (SimpleStatesImpl).
Doing that in this way states will be working only for that one view. Doing
it in my way by css "global" you will have it in all views.

<js:beads>
   <js:SimpleStatesImpl />
</js:beads>


>
> 3)
> Are there other ways to find such beads or is a sufficient documentation
> the
> one and only solution?
> In case of the latter: I guess it would be not so hard to automatically put
> all relevant Royale class names with its doc comments into an e.g.
> ElasticSearch index. Something like this would make it very easy to search
> for beads and components by using different full-text search patters... do
> you think this would be helpful?
>

I believe intelligent code completion will resolve that problem in lots of
cases. In Intellij you would find this bead probably easier.


> Thanks for help!
> Olaf
>
>
> [1]
> https://github.com/apache/royale-asjs/blob/develop/
> examples/royale/RoyaleStore/src/main/royale/productsView/
> ProductCatalogPanel.mxml#L540
>
> [2]
> https://paste.apache.org/C6GW
>
>
>
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>



-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
<https://www.patreon.com/piotrzarzycki>*

Re: Need help with states

Posted by Alex Harui <ah...@adobe.com>.
Because we have an ASDoc app, we have the opportunity to have smarter
filtering.  Feel free to add more asdoc tags and maybe some filtering
logic.

-Alex

On 12/27/17, 12:58 PM, "Olaf Krueger" <ma...@olafkrueger.net> wrote:

>>..so things "just work" without so much configuring
>
>For me, it is no problem to add some beads... as long there's a fair
>chance
>to find it ;-)
>
>Thanks,
>Olaf
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-roy
>ale-users.20374.n8.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7C8f0c5
>f36cced4e3412e108d54d6c90ec%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6
>36500051037606682&sdata=zQ9uQSpGhu0SOIuXLjga8itmQjVoElPkHnQqehqCVT8%3D&res
>erved=0


Re: Need help with states

Posted by Olaf Krueger <ma...@olafkrueger.net>.
>..so things "just work" without so much configuring

For me, it is no problem to add some beads... as long there's a fair chance
to find it ;-)

Thanks,
Olaf



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Need help with states

Posted by Alex Harui <ah...@adobe.com>.
Hi Olaf,

In RoyaleStore, the IStatesImpl is declared in CSS so every MXML fite can
pick it up without having to specify the bead in its bead list.  Maybe we
shouldn't have a special case like that.

I haven't looked, but hopefully the Express components should have a
default IStatesImpl so things "just work" without so much configuring.

HTH,
-Alex

On 12/26/17, 10:39 AM, "Olaf Krueger" <ma...@olafkrueger.net> wrote:

>Hi guys,
>the MXML and also the fx:style way works for me.
>
>Before asking here I've already thought about a missing bead and so I
>tried
>different ways to find out the name of the bead:
>IDEs CodeCompletion doesn't work cause the bead name doesn't start with
>"State*".
>Then I searched the asjs repo but the github search isn't very helpful
>here.
>Then I walked through the examples in order to find an example that makes
>use of states.  I found e.g. this [1], but because I didn't found a states
>related bead that 'enables the states feature' I finally thought such a
>bead
>is maybe not needed (against PAYG).
>
>So a few questions are left:
>1)
>Maybe I am blind but could somebody point me to the piece of code in this
>example [1] which 'enables the states feature'. Is it baked-in within
>other
>beads or components?
>
>2)
>I don't understand Piotr's code snippet [2]
>Why does it work? And what is the relation between styles and states?
>
>3)
>Are there other ways to find such beads or is a sufficient documentation
>the
>one and only solution?
>In case of the latter: I guess it would be not so hard to automatically
>put
>all relevant Royale class names with its doc comments into an e.g.
>ElasticSearch index. Something like this would make it very easy to search
>for beads and components by using different full-text search patters... do
>you think this would be helpful?
>
>Thanks for help!
>Olaf
>
>
>[1]
>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.co
>m%2Fapache%2Froyale-asjs%2Fblob%2Fdevelop%2Fexamples%2Froyale%2FRoyaleStor
>e%2Fsrc%2Fmain%2Froyale%2FproductsView%2FProductCatalogPanel.mxml%23L540&d
>ata=02%7C01%7Caharui%40adobe.com%7C259a7bd7cbd54734bf0b08d54c8ff671%7Cfa7b
>1b5a7b34438794aed2c178decee1%7C0%7C0%7C636499103560379160&sdata=UgE%2FG%2F
>mraBJ8Ny5yJAr3pWibAggU62zCzj7WEd%2Fg7nk%3D&reserved=0
>
>[2]
>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpaste.apa
>che.org%2FC6GW&data=02%7C01%7Caharui%40adobe.com%7C259a7bd7cbd54734bf0b08d
>54c8ff671%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636499103560379160&
>sdata=1tHJy3cihhJQvJKsZDXSFqrnHkmoC5yGx3zFcbXascU%3D&reserved=0
>
>
>
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-roy
>ale-users.20374.n8.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7C259a7
>bd7cbd54734bf0b08d54c8ff671%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6
>36499103560379160&sdata=wLDNSxVb8P3arAwS7U8YuVjv71DOdYzgbZSrvkLFF%2FA%3D&r
>eserved=0


RE: Need help with states

Posted by Olaf Krueger <ma...@olafkrueger.net>.
Hi Yishay,

>For what it’s worth I have an example [1] for States in the Examples repo.

Thanks, Yishay. Your examples are very helpful!
I've already looked at it two days ago but for whatever reason, the state's
branch appeared empty for me.

However, maybe it makes sense to add a hint regarding 'SimpleStatesImpl',
something like this [1].

Thanks,
Olaf

[1] https://github.com/yishayw/Examples/pull/2





--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

RE: Need help with states

Posted by Yishay Weiss <yi...@hotmail.com>.
For what it’s worth I have an example [1] for States in the Examples repo.

[1] https://github.com/yishayw/Examples/tree/States


From: Olaf Krueger<ma...@olafkrueger.net>
Sent: Tuesday, December 26, 2017 8:39 PM
To: users@royale.apache.org<ma...@royale.apache.org>
Subject: Re: Need help with states

Hi guys,
the MXML and also the fx:style way works for me.

Before asking here I've already thought about a missing bead and so I tried
different ways to find out the name of the bead:
IDEs CodeCompletion doesn't work cause the bead name doesn't start with
"State*".
Then I searched the asjs repo but the github search isn't very helpful here.
Then I walked through the examples in order to find an example that makes
use of states.  I found e.g. this [1], but because I didn't found a states
related bead that 'enables the states feature' I finally thought such a bead
is maybe not needed (against PAYG).

So a few questions are left:
1)
Maybe I am blind but could somebody point me to the piece of code in this
example [1] which 'enables the states feature'. Is it baked-in within other
beads or components?

2)
I don't understand Piotr's code snippet [2]
Why does it work? And what is the relation between styles and states?

3)
Are there other ways to find such beads or is a sufficient documentation the
one and only solution?
In case of the latter: I guess it would be not so hard to automatically put
all relevant Royale class names with its doc comments into an e.g.
ElasticSearch index. Something like this would make it very easy to search
for beads and components by using different full-text search patters... do
you think this would be helpful?

Thanks for help!
Olaf


[1]
https://github.com/apache/royale-asjs/blob/develop/examples/royale/RoyaleStore/src/main/royale/productsView/ProductCatalogPanel.mxml#L540

[2]
https://paste.apache.org/C6GW






--
Sent from: http://apache-royale-users.20374.n8.nabble.com/


Re: Need help with states

Posted by Olaf Krueger <ma...@olafkrueger.net>.
Hi guys,
the MXML and also the fx:style way works for me.

Before asking here I've already thought about a missing bead and so I tried
different ways to find out the name of the bead:
IDEs CodeCompletion doesn't work cause the bead name doesn't start with
"State*".
Then I searched the asjs repo but the github search isn't very helpful here.
Then I walked through the examples in order to find an example that makes
use of states.  I found e.g. this [1], but because I didn't found a states
related bead that 'enables the states feature' I finally thought such a bead
is maybe not needed (against PAYG).

So a few questions are left:
1)
Maybe I am blind but could somebody point me to the piece of code in this
example [1] which 'enables the states feature'. Is it baked-in within other
beads or components?

2)
I don't understand Piotr's code snippet [2]
Why does it work? And what is the relation between styles and states?

3)
Are there other ways to find such beads or is a sufficient documentation the
one and only solution?
In case of the latter: I guess it would be not so hard to automatically put
all relevant Royale class names with its doc comments into an e.g.
ElasticSearch index. Something like this would make it very easy to search
for beads and components by using different full-text search patters... do
you think this would be helpful?

Thanks for help!
Olaf


[1]
https://github.com/apache/royale-asjs/blob/develop/examples/royale/RoyaleStore/src/main/royale/productsView/ProductCatalogPanel.mxml#L540

[2]
https://paste.apache.org/C6GW






--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: Need help with states

Posted by Piotr Zarzycki <pi...@gmail.com>.
Hi Olaf,

You are missing bead SimpleStatesImpl, which need to be added in the
following way [1]

[1] https://paste.apache.org/C6GW

Thanks, Piotr :)


2017-12-25 23:42 GMT+01:00 Olaf Krueger <ma...@olafkrueger.net>:

> Hi,
> I am trying to change the text of a TextButton by using states [1] but the
> text of the button is always empty.
> I've tried several things but nothing works for me.
> It seems to me that that the value of currentState is set correctly, but it
> doesn't have any effect on the properties of the components?
>
> Thanks,
> Olaf
>
> [1] https://gist.github.com/ok-at-github/f521e91fe95bf5b3b03eddcc48e87f40
>
>
>
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>



-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
<https://www.patreon.com/piotrzarzycki>*