Need help with states

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Need help with states

Olaf Krueger
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/
Reply | Threaded
Open this post in threaded view
|

Re: Need help with states

Piotr Zarzycki
Hi Olaf,

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


Thanks, Piotr :)


2017-12-25 23:42 GMT+01:00 Olaf Krueger <[hidden email]>:
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

Reply | Threaded
Open this post in threaded view
|

Re: Need help with states

Gabe Harbs
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 <[hidden email]> wrote:

Hi Olaf,

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


Thanks, Piotr :)


2017-12-25 23:42 GMT+01:00 Olaf Krueger <[hidden email]>:
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


Reply | Threaded
Open this post in threaded view
|

Re: Need help with states

Alex Harui-2
Which component list?  It looks like it is in the basic-manifest in Core.swc.

-Alex

From: Harbs <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Monday, December 25, 2017 at 11:46 PM
To: "[hidden email]" <[hidden email]>
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 <[hidden email]> wrote:

Hi Olaf,

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


Thanks, Piotr :)


2017-12-25 23:42 GMT+01:00 Olaf Krueger <[hidden email]>:
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


Reply | Threaded
Open this post in threaded view
|

Re: Need help with states

Gabe Harbs
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 <[hidden email]> wrote:

Which component list?  It looks like it is in the basic-manifest in Core.swc.

-Alex

From: Harbs <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Monday, December 25, 2017 at 11:46 PM
To: "[hidden email]" <[hidden email]>
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 <[hidden email]> wrote:

Hi Olaf,

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


Thanks, Piotr :)


2017-12-25 23:42 GMT+01:00 Olaf Krueger <[hidden email]>:
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 



Reply | Threaded
Open this post in threaded view
|

Re: Need help with states

Olaf Krueger
In reply to this post by Piotr Zarzycki
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/
Reply | Threaded
Open this post in threaded view
|

Re: Need help with states

Piotr Zarzycki
Olaf,

Comments inline.


Thanks, Piotr

2017-12-26 19:39 GMT+01:00 Olaf Krueger <[hidden email]>:
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



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki

Reply | Threaded
Open this post in threaded view
|

Re: Need help with states

Alex Harui-2
In reply to this post by Olaf Krueger
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" <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

RE: Need help with states

Yishay Weiss
In reply to this post by Olaf Krueger

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: [hidden email]
Sent: Tuesday, December 26, 2017 8:39 PM
To: [hidden email]
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/

 

Reply | Threaded
Open this post in threaded view
|

Re: Need help with states

Olaf Krueger
In reply to this post by Piotr Zarzycki
>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/
Reply | Threaded
Open this post in threaded view
|

Re: Need help with states

Olaf Krueger
In reply to this post by Alex Harui-2
>..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/
Reply | Threaded
Open this post in threaded view
|

Re: Need help with states

Piotr Zarzycki
In reply to this post by Olaf Krueger
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 <[hidden email]>:
>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



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki

Reply | Threaded
Open this post in threaded view
|

RE: Need help with states

Olaf Krueger
In reply to this post by Yishay Weiss
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/
Reply | Threaded
Open this post in threaded view
|

Re: Need help with states

Olaf Krueger
In reply to this post by Piotr Zarzycki
>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/
Reply | Threaded
Open this post in threaded view
|

Re: Need help with states

Alex Harui-2
In reply to this post by Olaf Krueger
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" <[hidden email]> 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