You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by yishayw <yi...@hotmail.com> on 2017/07/25 07:33:37 UTC

Re: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

I don't see any event being dispatched by menu. Are we supposed to listen to
the model for events?



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63529.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

RE: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by Yishay Weiss <yi...@hotmail.com>.
I don’t think those lines would be enough for all MDL controls. We’re only using a subset.

From: piotrz<ma...@gmail.com>
Sent: Wednesday, August 2, 2017 2:02 PM
To: dev@flex.apache.org<ma...@flex.apache.org>
Subject: RE: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Yishay,

I think I will create jira and add those css to MDL in order to get rid off
that ugly line with exclusion.

Anyone seeing some danger doing that ?

Thanks,
Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63659.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.


RE: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by piotrz <pi...@gmail.com>.
Yishay,

I think I will create jira and add those css to MDL in order to get rid off
that ugly line with exclusion. 

Anyone seeing some danger doing that ?

Thanks,
Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63659.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

RE: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by Yishay Weiss <yi...@hotmail.com>.
Good catch. You’re correct that we’re not using -compiler.exclude-defaults-css-files anywhere.

We have some CSS overrides that take care of the controls we’re using. Generally, we just inspect the DOM and figure out which styles need to be fixed and add those to our CSS. Hopefully, this won’t be necessary when the good looking basic look&feel is ready.

.mdl-checkbox__label
{
                font-size: 12px;
}

.mdl-slider
{
                margin: 0px;
}

.mdl-textfield{
                padding: 0px;
}

.mdl-button:hover{
                padding: 0 16px;
                border: none;
                background-color: rgba(158,158,158,.2);
}

.mdl-slider__background-flex
{
                margin: 0px;

                /*width: calc(100% - 12px);*/
}

From: piotrz<ma...@gmail.com>
Sent: Wednesday, August 2, 2017 1:11 AM
To: dev@flex.apache.org<ma...@flex.apache.org>
Subject: RE: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Hi Yishay,

I've analyzed your stacktrace and I think I understand why it is working in
your app and it is not in MDLExample.

As I remember from Harbs presentation from ApacheCON that your app is using
MDL library along with Basic module.

In general when someone would like to build your application using MDL
module you have to exclude default.css from Basic, cause UI is breaking up
if we will not do this.

-compiler.exclude-defaults-css-files=Basic-0.9.0-SNAPSHOT-js.swc:defaults.css

Since you probably do not have above line anywhere in your application your
list has following bead:

IBeadController:
ClassReference("org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController");

Above bead emits "change" event, cause it listens to emitted by each item
click provided by bead

IBeadController:
ClassReference("org.apache.flex.html.beads.controllers.ItemRendererMouseController");

I just pushed fix for this issue, but it would be great if you could
describe in separate thread how did you combined MDL library with Basic in
your app without excluding defaults.css.

Thanks,
Piotr





-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63639.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.


RE: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by piotrz <pi...@gmail.com>.
Hi Yishay,

I've analyzed your stacktrace and I think I understand why it is working in
your app and it is not in MDLExample.

As I remember from Harbs presentation from ApacheCON that your app is using
MDL library along with Basic module. 

In general when someone would like to build your application using MDL
module you have to exclude default.css from Basic, cause UI is breaking up
if we will not do this.

-compiler.exclude-defaults-css-files=Basic-0.9.0-SNAPSHOT-js.swc:defaults.css

Since you probably do not have above line anywhere in your application your
list has following bead:

IBeadController:
ClassReference("org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController");

Above bead emits "change" event, cause it listens to emitted by each item
click provided by bead

IBeadController:
ClassReference("org.apache.flex.html.beads.controllers.ItemRendererMouseController");

I just pushed fix for this issue, but it would be great if you could
describe in separate thread how did you combined MDL library with Basic in
your app without excluding defaults.css.

Thanks,
Piotr





-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63639.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

RE: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by yishayw <yi...@hotmail.com>.
Added the stack trace to the bug.



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63597.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

RE: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by piotrz <pi...@gmail.com>.
Exact that example is also do not work for me. I don't get change event when
I'm clicking on the item.
It has been swallowed somewhere - That's why I asked you to show me
stacktrace of event. 

You can get it once set break point in event handler of change in your menu.

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63586.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

RE: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by Yishay Weiss <yi...@hotmail.com>.
Is the example I posted on JIRA working for you?

From: piotrz<ma...@gmail.com>
Sent: Thursday, July 27, 2017 9:00 AM
To: dev@flex.apache.org<ma...@flex.apache.org>
Subject: RE: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

I'm thinking about it more and despite that is working for you I think
something is evidently  wrong.

Maybe I have to produce in the MenuView change event. Currently after attach
your ItemRendererMouseController we have click on each renderer.

On the other hand this "change" for some reason do not suit for me to that
control...

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63581.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.


RE: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by piotrz <pi...@gmail.com>.
I'm thinking about it more and despite that is working for you I think
something is evidently  wrong. 

Maybe I have to produce in the MenuView change event. Currently after attach
your ItemRendererMouseController we have click on each renderer. 

On the other hand this "change" for some reason do not suit for me to that
control...

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63581.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

RE: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by piotrz <pi...@gmail.com>.
Yishay,

Could you show me how look like stacktrace in the browser when you click on
the Menu item. I would like to see whole path - who provide you "change"
event in your handler. (myMenu_changeHandler) 
Your example is also not working for me.

Thanks,
Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63580.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

RE: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by Yishay Weiss <yi...@hotmail.com>.
Piotr, sorry for the confusion, I’m not reverting my change. After it, I am getting the ‘change’ event, no need for an ‘itemClicked’ event which, is Alex had proposed, would be confusing for other input methods. I fixed the visual confusion.

I assigned you a JIRA [1] regarding the example, thanks.

[1] https://issues.apache.org/jira/browse/FLEX-35344

From: piotrz<ma...@gmail.com>
Sent: Wednesday, July 26, 2017 11:48 AM
To: dev@flex.apache.org<ma...@flex.apache.org>
Subject: RE: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Ahh...I didn't understand you then. I thought it is all about click - I
thought that you do not getting "change" event which is suppose to be
reaction on click on item. If I think about it more it could confuse user:
"change" -> "click", but we are using such model in more places, that change
is a representation of more general approach.

Sometimes is "click" in the other places is selectedItem (MDL DropDownList)
etc. Do you see some component in Basic where we are using "itemClick" event
and expose it to the user ?

Thanks,
Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63555.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.


RE: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by piotrz <pi...@gmail.com>.
Ahh...I didn't understand you then. I thought it is all about click - I
thought that you do not getting "change" event which is suppose to be
reaction on click on item. If I think about it more it could confuse user:
"change" -> "click", but we are using such model in more places, that change
is a representation of more general approach.

Sometimes is "click" in the other places is selectedItem (MDL DropDownList)
etc. Do you see some component in Basic where we are using "itemClick" event
and expose it to the user ?

Thanks,
Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63555.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

RE: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by Yishay Weiss <yi...@hotmail.com>.
Piotr, after thinking about it, I’m reverting the change. I don’t think it’s right for a menu to have a selected item, and it causes visual confusion the next time it appears. It’s probably best to just propagate the ‘itemClicked’ event with some info on the item renderer data.

From: piotrz<ma...@gmail.com>
Sent: Wednesday, July 26, 2017 10:30 AM
To: dev@flex.apache.org<ma...@flex.apache.org>
Subject: Re: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Yishay,

I did quick look into this problem and not sure what is happening yet.
Please raise jira for me where you describe that your code in the example is
working, but this one in MDLExample not.

I will look into that soon.

Thanks,
Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63553.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by piotrz <pi...@gmail.com>.
Yishay,

I did quick look into this problem and not sure what is happening yet.
Please raise jira for me where you describe that your code in the example is
working, but this one in MDLExample not. 

I will look into that soon.

Thanks,
Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63553.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by yishayw <yi...@hotmail.com>.
yishayw wrote
> the example (be051df2bb40fec7d29cf1a934fcbbf19f8d75b7) isn't showing this
> behavior, please have a look

Should be

4eb3eaf38277187919c24b9a6099ec998d4ff627




--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63540.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by piotrz <pi...@gmail.com>.
Thanks Yishay! I will look into that I hope later today. :)

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63539.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by yishayw <yi...@hotmail.com>.
Piotr,
I changed menu to extend list and am now getting the change event in my test
app [1]. For some reason the example
(be051df2bb40fec7d29cf1a934fcbbf19f8d75b7) isn't showing this behavior,
please have a look if possible.

Peter,
It looks like your change (be051df2bb40fec7d29cf1a934fcbbf19f8d75b7) made it
so Menu no longer implemented IList. Was that by design? If so, please feel
free to fix my latest commit. 

Thanks.

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



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63538.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by piotrz <pi...@gmail.com>.
I think that was introduced by Peter after container changes. Could you check
in the history whether earlier Menu extends List ? - If extends earlier
maybe that would be better way to fix that.

Thanks,
Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63532.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by yishayw <yi...@hotmail.com>.
'change' isn't dispatched. I'll fix it. Can you explain why it extends
DataContainer and not list (which has selectedItem prop and 'change' event)?



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63531.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS, MDL] Menu with dataProvider and itemRenderer API

Posted by piotrz <pi...@gmail.com>.
Hi Yishay,

But is it not working when you add "change" handler ? If not try to add to
the Menu class:

[Event(name="change", type="org.apache.flex.events.Event")]

Whatever you are going to do in order to fix that, please update MDLExample
to handle "change" event. If you will not have time to dig into that, please
raise jira I will look into that soon.

Thanks,
Piotr




-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MDL-Menu-with-dataProvider-and-itemRenderer-API-tp57637p63530.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.