flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Rovira <carlos.rov...@codeoscopic.com>
Subject Re: [FlexJS] List Structure
Date Tue, 22 Nov 2016 21:32:14 GMT
> Well if it were up to me, the Basic List and SimpleList will only support
> the dataprovider/factory mechanism and not support setting random
> children.


But change itemrenderer class factory is something needed, if not we're
making the list use cases restricted.


> Again, I am trying to make sure the Basic set does not have
> just-in-case code.  I think you've added components that thinly wrap HTML
> elements so I would suggest we add UL and OL components that would extend
> Container.  We could also have more Flex-like names for UL and OL like
> UnorderedListContainer and OrderedListContainer.
>
>
Since we are adding components like H1 (to 6), A, Span, Div and so
on...maybe we cold add UL, OL, LI...since those are HTML counterparts.



> So, for MDL, my thinking would center around what your target users
> expect.  Will they be surprised or annoyed to have to learn about data
> providers in order to make a list?  Would they expect to find an LI
> component?  If so, then instead of extending HTML List or SimpleList, you
> may just want to extend Container.
>

I think we want best of both worlds. we need to get All MDL component set,
some of them are in Flex (Button, Slider, Switch...List), but others not
(Badge, Card, Snackbar, Table...). For example, a Card could be similar to
Panel, but are not the same, so I think is wrong to try to make a Card from
a Panel. For that reason I made Card from a basic Container, and the same
with Card subcomponents (CardActions, CardSupportingText...)

List is a case where we want a flex behaviour (data provider, selected
Index or item, add to data provider....) but all with the look and feel of
MDL List. If we don't get the flex ease in this control, a flexjs user will
feel disappointed about how cumbersome is to make an app without the old
flex way of list management that we all think is the right way.

I think, I should start with flexjs List, but List component should not
"write" html tags. I think is the ListView Datagroup how needs to write the
initial ul (with className="mdl-list"), then the item renderer will write a
li as its root (with className="mdl-list__item-primary-content").

So I think we need to allow flexjs that a component in JS does not has to
write a tag and let subcomponents to do it when is needed.
If a intermediate component is designed to not write any tag but has a
subcomponent that wants to write, this should be parented to the first
parent container that writes something....makes this sense?

Summary, I think we're limited by the fact a flexjs component always need
to write one html tag, and we need to allow flexjs framework to let
createElement returns null (saying "hey!, I don't want to write anything
and my subcomps will be parented to my parent")






>
> Thoughts?
> -Alex
>
> On 11/22/16, 10:02 AM, "carlos.rovira@gmail.com on behalf of Carlos
> Rovira" <carlos.rovira@gmail.com on behalf of carlosrovira@apache.org>
> wrote:
>
> >> Ugh.  SimpleList got ruined in the back port from JS to AS.
> >>
> >>
> >So maybe I should wait for some fix on this component?
> >
> >
> >> It occurred to me though that both SimpleList and List/ListBase are
> >>going
> >> to be oriented towards the "ItemRenderer Factory" API.  In such a case,
> >> there is a dataProvider and for List you specify a template (an
> >> ItemRenderer) and a factory and the children are generated by the
> >>factory.
> >>  For MDL, do you want to do the same thing or make it more like generic
> >> HTML lists where you have to explicitly specify each child.  IMO, a
> >> generic HTML List of ul/li tags essentially means there is no template.
> >> The contents of each li tag can have a completely different structure.
> >>
> >> Thoughts?
> >> -Alex
> >>
> >>
> >I think List should support both, a dataProvider that gives data and you
> >could have an factory
> >that created one kind of item renderers or more that one (in old flex sdk
> >we could have one item renderer in different rows (and in data grid by
> >cell)
> >
> >If you check the MDL List example page here:
> >https://getmdl.io/components/index.html#lists-section
> >you could see this structure:
> >
> ><ul class='mdl-list'> <li class="mdl-list__item"> <span class="
> >mdl-list__item-primary-content"></span> </li> <li class="mdl-list__item">
> ><
> >span class="mdl-list__item-primary-content"></span> </li> <li class="
> >mdl-list__item"> <span class="mdl-list__item-primary-content"></span>
> ></li>
> ></ul>
> >
> >So I think the List should provide the ul and has an the user should
> >create
> >his own item renderer with provided pieces (more common) and his own made
> >pieces.
> >
> >
> >
> >--
> >Carlos Rovira
> >http://about.me/carlosrovira
>
>


-- 

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.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message