You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Harbs <ha...@gmail.com> on 2016/12/01 10:49:22 UTC
[FlexJS]js:List
I’m not sure if I’m doing something wrong, or there is an actual problem…
I have the following markup in my mxml:
<js:List id="templateList" width="100%">
<js:style>
<js:SimpleCSSStyles marginTop="5" />
</js:style>
</js:List>
I don’t know the content of the List until some point at runtime and Data Binding is too confusing for my to try and mess with that.
I have the following code which gets run when the list of objects is actually constructed:
templateList.dataProvider = new ArrayList(dataModel.templateList);
By inspecting List, I see that the ArrayList is added to the (ArraySelectionModel) model.
The beads in the strand are:
0: org.apache.flex.html.beads.models.ArraySelectionModel
1: org.apache.flex.html.beads.ListView
2: org.apache.flex.html.beads.models.ViewportModel
3: org.apache.flex.html.supportClasses.ScrollingViewport
4: org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController
5: org.apache.flex.html.beads.DataItemRendererFactoryForArrayData
6: org.apache.flex.core.ItemRendererClassFactory
7: org.apache.flex.core.ItemRendererClassFactory
8: org.apache.flex.html.beads.layouts.VerticalLayout
The problem is that nothing is actually added to the HTML Element tree:
<div class="List" id="fontList" style="display: block; position: absolute; width: 231px; margin-top: 5px; left: 0px; height: 231px; top: 95px;"><div class="ListDataGroup" style="display: block; position: absolute; overflow: auto; left: 1px; top: 1px; width: 229px; height: 229px;"></div></div>
What’s wrong?
Thanks,
Harbs
Re: [FlexJS]js:List
Posted by Peter Ent <pe...@adobe.com>.
There are beads designed for Array (the default set) and ArrayList. You
need to change the data provider and selection models to match. There is
code that does something like: dataProvider is Array and that will be null
when the dataProvider is an ArrayList so the code will just return from
that function without doing anything.
‹peter
On 12/1/16, 6:26 AM, "yishayw" <yi...@hotmail.com> wrote:
>Did you try feeding the data provider with an array instead of an
>arraylist?
>The model seems to expect that.
>
>
>
>--
>View this message in context:
>http://apache-flex-development.2333347.n4.nabble.com/FlexJS-js-List-tp5687
>0p56873.html
>Sent from the Apache Flex Development mailing list archive at Nabble.com.
Re: [FlexJS]js:List
Posted by Harbs <ha...@gmail.com>.
An array makes it work.
Thanks.
On Dec 1, 2016, at 1:26 PM, yishayw <yi...@hotmail.com> wrote:
> Did you try feeding the data provider with an array instead of an arraylist?
> The model seems to expect that.
>
>
>
> --
> View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-js-List-tp56870p56873.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
Re: [FlexJS]js:List
Posted by yishayw <yi...@hotmail.com>.
Did you try feeding the data provider with an array instead of an arraylist?
The model seems to expect that.
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-js-List-tp56870p56873.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.