You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by piotrz <pi...@gmail.com> on 2016/12/29 17:41:31 UTC

[FlexJS, MDL] Menu with dataProvider and itemRenderer API

Hi Carlos,

Since I've finished Snackbar I can take next task. :) I see that Menu need
to be updated with dataProvider and item renderer API.
I will probably go same direction as you went with Lists - using
ISelectionModel. I'm going also introduce in "core" package MenuEvent with
ITEM_CLICK constant and new controller which handle click on menu item.

Probably I will need to split Menu component into "Menu" and "MenuView"
class.

Let me know if you have any thoughts about that or different idea.

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-tp57637.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

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

Posted by Carlos Rovira <ca...@codeoscopic.com>.
I copied from the Peter example "ListExample"

2016-12-30 11:14 GMT+01:00 piotrz <pi...@gmail.com>:

> Carlos,
>
> One question why you didn't use "DataItemRendererFactoryForArrayData" from
> core package in List ? You just copied and create new class
> "ItemRendererFactoryForArrayData" - I don't see diffs.
>
> 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-tp57637p57662.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>



-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

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

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

One question why you didn't use "DataItemRendererFactoryForArrayData" from
core package in List ? You just copied and create new class
"ItemRendererFactoryForArrayData" - I don't see diffs.

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-tp57637p57662.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

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

Posted by Carlos Rovira <ca...@codeoscopic.com>.
Rigth, i'm off and don't hace access to code but I think  menu could be a
list and menuitem could be a itemrenderer.... but be free to experiment :)



El El vie, 30 dic 2016 a las 11:47, piotrz <pi...@gmail.com>
escribió:

> I went through List implementation and see that contents of data provider
> is
>
> handled by: "IDataProviderItemRendererMapper" implementation. It creates
>
> item renderers for my view.
>
>
>
> I think I could go with following implementation:
>
>
>
> MenuView will implement IListView or event extends current ListView.
>
> MenuItem will extend ListItemRenderer.
>
>
>
> In other words our Menu will be some kind of MDL List form.
>
>
>
> Let me know what do you think.
>
>
>
> 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-tp57637p57666.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>.
If I understand correctly it is planned for v2 [1] of MDL. I need to think
about support sub menu. In theory one of my item renderer MenuItem could be
submenu.

[1] https://github.com/google/material-design-lite/issues/4235

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-tp57637p57679.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

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

Posted by OmPrakash Muppirala <bi...@gmail.com>.
On Dec 30, 2016 8:31 AM, "Carlos Rovira" <ca...@codeoscopic.com>
wrote:

In the examples I found there's no sub items, but we should look to see if
there's more. I think that should be supported, if not a menu with only one
 level seems very limited to me...



Angular Material has menu with sub menus.  We should definitely support
that.

Thanks,
Om


2016-12-30 16:54 GMT+01:00 Alex Harui <ah...@adobe.com>:

>
>
> On 12/30/16, 2:31 AM, "piotrz" <pi...@gmail.com> wrote:
>
> >In other words our Menu will be some kind of MDL List form.
>
> For a simple Menu this should be fine.  For a Menu with sub-menus, it will
> need many of the things Tree needs.  I don't know if MDL has a Tree, or
> not.
>
> Just me thinking out loud...
> -Alex
>
>


--

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

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

Posted by Carlos Rovira <ca...@codeoscopic.com>.
In the examples I found there's no sub items, but we should look to see if
there's more. I think that should be supported, if not a menu with only one
 level seems very limited to me...

2016-12-30 16:54 GMT+01:00 Alex Harui <ah...@adobe.com>:

>
>
> On 12/30/16, 2:31 AM, "piotrz" <pi...@gmail.com> wrote:
>
> >In other words our Menu will be some kind of MDL List form.
>
> For a simple Menu this should be fine.  For a Menu with sub-menus, it will
> need many of the things Tree needs.  I don't know if MDL has a Tree, or
> not.
>
> Just me thinking out loud...
> -Alex
>
>


-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

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

Posted by Alex Harui <ah...@adobe.com>.

On 12/30/16, 2:31 AM, "piotrz" <pi...@gmail.com> wrote:

>In other words our Menu will be some kind of MDL List form.

For a simple Menu this should be fine.  For a Menu with sub-menus, it will
need many of the things Tree needs.  I don't know if MDL has a Tree, or
not.

Just me thinking out loud...
-Alex


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

Posted by piotrz <pi...@gmail.com>.
I went through List implementation and see that contents of data provider is
handled by: "IDataProviderItemRendererMapper" implementation. It creates
item renderers for my view. 

I think I could go with following implementation:

MenuView will implement IListView or event extends current ListView.
MenuItem will extend ListItemRenderer.

In other words our Menu will be some kind of MDL List form. 

Let me know what do you think.

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-tp57637p57666.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

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

Posted by Carlos Rovira <ca...@apache.org>.
2016-12-29 18:41 GMT+01:00 piotrz <pi...@gmail.com>:

> Hi Carlos,
>
> Since I've finished Snackbar I can take next task. :) I see that Menu need
> to be updated with dataProvider and item renderer API.
> I will probably go same direction as you went with Lists - using
> ISelectionModel. I'm going also introduce in "core" package MenuEvent with
> ITEM_CLICK constant and new controller which handle click on menu item.
>
> Probably I will need to split Menu component into "Menu" and "MenuView"
> class.
>
> Let me know if you have any thoughts about that or different idea.
>
> Piotr
>
>
>
That's great Piotr :)

Right, we need to do something like in mdl List, and I think we should
introduce Controller and View like in Slider
I was thinking about it since I don't like to split in many pieces that
only will introduce complexity, but the reason to do it is prepare the
components for a SWF implementation.







>
> -----
> 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-tp57637.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.

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

Posted by yishayw <yi...@hotmail.com>.
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 piotrz <pi...@gmail.com>.
Hi Alex,

Thanks. That definately make sense to me. I'll try to look deeper into List
or some other component and reuse "selected" or "change". I'm rather
thinking about "change" - cause "selected" brings to mind something which is
constant from UI point of view. When you click on the menu you expect some
action immediately.

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-tp57637p57655.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

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

Posted by Alex Harui <ah...@adobe.com>.

On 12/29/16, 9:41 AM, "piotrz" <pi...@gmail.com> wrote:

>Hi Carlos,
>
>Since I've finished Snackbar I can take next task. :) I see that Menu need
>to be updated with dataProvider and item renderer API.
>I will probably go same direction as you went with Lists - using
>ISelectionModel. I'm going also introduce in "core" package MenuEvent with
>ITEM_CLICK constant and new controller which handle click on menu item.

You can totally ignore this if you want, but I would like to see us avoid
using "click" and use "selected" or "change".  IMO, a "click" is a
low-level interaction.  Heavier renderers can certainly dispatch such a
thing, but the "click" may not always mean that something was selected.
Think of dividers in a menu or an unselectable item in a list, for
example.  It is up to the controller to determine the higher level meaning
of that click.  Also, if someone is using keyboard access, the item won't
actually be clicked and the lower-level events of keyDown keyUp again are
used by the controller to determine whether something is selected.  So
there should be an event with a higher level semantic meaning that the
selection changed.  Does List already have one that we can re-use?

My 2 cents,
-Alex


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

Posted by Carlos Rovira <ca...@codeoscopic.com>.
Hi Piotr,

if the Class is the same I don't have any problem to remove the redundant
class. I only was following Peter's ListExample, so If you think is equal
feel free to remove.

Thanks


2017-01-02 15:17 GMT+01:00 piotrz <pi...@gmail.com>:

> I see only one difference which I think could be moved to
> "DataItemRendererFactoryForArrayData"
>
> ItemRendererFactoryForArrayData:
> var component:UIBase = _strand as UIBase;
> ir.labelField = component["labelField"];
>
> DataItemRendererFactoryForArrayData:
> labelField = (listView.host as List).labelField;
>
> If we moved code from our bead to class from core we could delete
> "ItemRendererFactoryForArrayData".
>
> 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-tp57637p57748.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>



-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

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

Posted by piotrz <pi...@gmail.com>.
I see only one difference which I think could be moved to
"DataItemRendererFactoryForArrayData"

ItemRendererFactoryForArrayData:
var component:UIBase = _strand as UIBase;
ir.labelField = component["labelField"];

DataItemRendererFactoryForArrayData:
labelField = (listView.host as List).labelField;

If we moved code from our bead to class from core we could delete
"ItemRendererFactoryForArrayData".

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-tp57637p57748.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>.
Carlos,

I just switched your "ItemRendererFactoryForArrayData" to
"DataItemRendererFactoryForArrayData" for list and menu. Everything seems to
be working fine. I think we should use class from core and remove redundant
code.

Maybe try to change it yourself to see whether I didn't miss anything.

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-tp57637p57747.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 Carlos,

I think I have spent enough time yesterday on this. I have removed all code
related to sub menu.

Ad. 1) I just pushed code related to this one
Ad. 2) I have no idea why this started to appear and it's even worst.
Binding is not working totally. I will start separate thread about that -
Maybe Alex will help.
Ad. 3) No problem I will create separate page. :)

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-tp57637p57737.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

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

Posted by Carlos Rovira <ca...@codeoscopic.com>.
So cool Piotr :)

if submenus are coming in MDL v2 and now are not supported, I think you
should not spend more time and wait to mdl v2 to implement it and jump to
other thing.

Some things I saw:

1) I didn't see in the new example item "separators" as in the old example.

2) building MDLExample I saw this two warnings binding related:

/Users/carlosrovira/Dev/Flex/source/flexjs/flex-asjs/examples/flexjs/MDLExample/src/main/flex/itemRenderers/CustomListItemRenderer.mxml(41):
col: 25 Data binding will not be able to detect assignments to 'label'.
    <js:Span text="{data.label}">
                        ^
/Users/carlosrovira/Dev/Flex/source/flexjs/flex-asjs/examples/flexjs/MDLExample/src/main/flex/itemRenderers/CustomMenuItemRenderer.mxml(27):
col: 42 Data binding will not be able to detect assignments to 'disabled'.
        <mdl:Disabled disabled="{menuItem.disabled}"/>

Hope you could take a look.

3) This is more about organization: Could you as well separate the example
to its own "Menus" page? I'd like to end removing the Others as we end
polishing the MDLExample.

Thanks for the new Menu, now it looks very "Flex" ! :)


2017-01-01 21:52 GMT+01:00 piotrz <pi...@gmail.com>:

> Menu has been updated with dataProvider API. :)
>
> Menu class didn't change to much, because it's reusing ListView. I had to
> change a bit one place in ListView where there were strand was casted to
> List - I saw your comments Carlos in that place - we really need to think
> about some interface in the future.
> MenuItem was transformed to MenuItemRenderer.
>
> I was also spend bunch of time on creating Menu item renderer with sub
> menu.
> I put inside item renderer another Menu. :) Unfortunately sub menu do not
> want to show. There is something which these sub menu do not like when it's
> placed inside renderer. - If I won't find solution I will leave it for now
> as it is and jump to another component.
>
> 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-tp57637p57724.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>



-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

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

Posted by piotrz <pi...@gmail.com>.
Menu has been updated with dataProvider API. :) 

Menu class didn't change to much, because it's reusing ListView. I had to
change a bit one place in ListView where there were strand was casted to
List - I saw your comments Carlos in that place - we really need to think
about some interface in the future.
MenuItem was transformed to MenuItemRenderer.

I was also spend bunch of time on creating Menu item renderer with sub menu.
I put inside item renderer another Menu. :) Unfortunately sub menu do not
want to show. There is something which these sub menu do not like when it's
placed inside renderer. - If I won't find solution I will leave it for now
as it is and jump to another component.

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-tp57637p57724.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.