Re: DropDownList with ArrayList

2018-01-26 Thread Gabe Harbs
Yup. And an Express version should probably use a bead which can handle either 
Array or ICollection dataProviders.

> On Jan 26, 2018, at 3:32 PM, Peter Ent  wrote:
> 
> In PAYG fashion we/you would need to create a new set of beads that work
> with ICollectionView rather than generalizing.
> 
> ‹peter
> 
> On 1/25/18, 5:36 PM, "Gabe Harbs"  wrote:
> 
>> Yeah. Maybe. In my case, I just used Array instead of ArrayList, but that
>> shouldn¹t really be necessaryŠ
>> 
>>> On Jan 26, 2018, at 12:29 AM, Piotr Zarzycki
>>>  wrote:
>>> 
>>> Hi Harbs,
>>> 
>>> I've looked couple of times into the DropDownList from Basic. Maybe it's
>>> time to reorganize things. Add there View, Model, Renderers etc ? I did
>>> that for MDL DropDownList.
>>> 
>>> Thanks, Piotr
>>> 
>>> 2018-01-25 23:18 GMT+01:00 Gabe Harbs :
>>> 
 The dataProvider setter in DropDownList has the following code:
 
   for (i = 0; i < n; i++) {
   opt = document.createElement('option') as
 HTMLOptionElement;
   if (lf)
   opt.text = value[i][lf];
   else
   opt.text = value[i];
   dd.add(opt, null);
   }
 
 Basically, it makes the assumption that the dataProvider is an
 index-accessible object. This is not the case if the dataProvider is a
 collection. In that case, the code should be something like this:
 
   opt.text = value.getItemAt(i)[lf];
   else
   opt.text = value.getItemAt(i);
 
 I¹m not sure of the best way to generalize this.
 
 Thoughts?
 Harbs
>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> 
>>> Piotr Zarzycki
>>> 
>>> Patreon: 
>>> *https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.pat
>>> reon.com%2Fpiotrzarzycki&data=02%7C01%7Cpent%40adobe.com%7C724d30423d3844
>>> 1d3d2208d564441339%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636525165
>>> 903100864&sdata=ZkXTZnuXlNS%2BK3mWSES4ZO2l8BJWRepVkMgxes4FbNM%3D&reserved
>>> =0
>>> 
>>> >> reon.com%2Fpiotrzarzycki&data=02%7C01%7Cpent%40adobe.com%7C724d30423d3844
>>> 1d3d2208d564441339%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636525165
>>> 903100864&sdata=ZkXTZnuXlNS%2BK3mWSES4ZO2l8BJWRepVkMgxes4FbNM%3D&reserved
>>> =0>*
>> 
> 



Re: DropDownList with ArrayList

2018-01-26 Thread Peter Ent
In PAYG fashion we/you would need to create a new set of beads that work
with ICollectionView rather than generalizing.

‹peter

On 1/25/18, 5:36 PM, "Gabe Harbs"  wrote:

>Yeah. Maybe. In my case, I just used Array instead of ArrayList, but that
>shouldn¹t really be necessaryŠ
>
>> On Jan 26, 2018, at 12:29 AM, Piotr Zarzycki
>> wrote:
>> 
>> Hi Harbs,
>> 
>> I've looked couple of times into the DropDownList from Basic. Maybe it's
>> time to reorganize things. Add there View, Model, Renderers etc ? I did
>> that for MDL DropDownList.
>> 
>> Thanks, Piotr
>> 
>> 2018-01-25 23:18 GMT+01:00 Gabe Harbs :
>> 
>>> The dataProvider setter in DropDownList has the following code:
>>> 
>>>for (i = 0; i < n; i++) {
>>>opt = document.createElement('option') as
>>> HTMLOptionElement;
>>>if (lf)
>>>opt.text = value[i][lf];
>>>else
>>>opt.text = value[i];
>>>dd.add(opt, null);
>>>}
>>> 
>>> Basically, it makes the assumption that the dataProvider is an
>>> index-accessible object. This is not the case if the dataProvider is a
>>> collection. In that case, the code should be something like this:
>>> 
>>>opt.text = value.getItemAt(i)[lf];
>>>else
>>>opt.text = value.getItemAt(i);
>>> 
>>> I¹m not sure of the best way to generalize this.
>>> 
>>> Thoughts?
>>> Harbs
>> 
>> 
>> 
>> 
>> -- 
>> 
>> Piotr Zarzycki
>> 
>> Patreon: 
>>*https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.pat
>>reon.com%2Fpiotrzarzycki&data=02%7C01%7Cpent%40adobe.com%7C724d30423d3844
>>1d3d2208d564441339%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636525165
>>903100864&sdata=ZkXTZnuXlNS%2BK3mWSES4ZO2l8BJWRepVkMgxes4FbNM%3D&reserved
>>=0
>> 
>>>reon.com%2Fpiotrzarzycki&data=02%7C01%7Cpent%40adobe.com%7C724d30423d3844
>>1d3d2208d564441339%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636525165
>>903100864&sdata=ZkXTZnuXlNS%2BK3mWSES4ZO2l8BJWRepVkMgxes4FbNM%3D&reserved
>>=0>*
>



Re: DropDownList with ArrayList

2018-01-25 Thread Gabe Harbs
Yeah. Maybe. In my case, I just used Array instead of ArrayList, but that 
shouldn’t really be necessary…

> On Jan 26, 2018, at 12:29 AM, Piotr Zarzycki  
> wrote:
> 
> Hi Harbs,
> 
> I've looked couple of times into the DropDownList from Basic. Maybe it's
> time to reorganize things. Add there View, Model, Renderers etc ? I did
> that for MDL DropDownList.
> 
> Thanks, Piotr
> 
> 2018-01-25 23:18 GMT+01:00 Gabe Harbs :
> 
>> The dataProvider setter in DropDownList has the following code:
>> 
>>for (i = 0; i < n; i++) {
>>opt = document.createElement('option') as
>> HTMLOptionElement;
>>if (lf)
>>opt.text = value[i][lf];
>>else
>>opt.text = value[i];
>>dd.add(opt, null);
>>}
>> 
>> Basically, it makes the assumption that the dataProvider is an
>> index-accessible object. This is not the case if the dataProvider is a
>> collection. In that case, the code should be something like this:
>> 
>>opt.text = value.getItemAt(i)[lf];
>>else
>>opt.text = value.getItemAt(i);
>> 
>> I’m not sure of the best way to generalize this.
>> 
>> Thoughts?
>> Harbs
> 
> 
> 
> 
> -- 
> 
> Piotr Zarzycki
> 
> Patreon: *https://www.patreon.com/piotrzarzycki
> *



Re: DropDownList with ArrayList

2018-01-25 Thread Piotr Zarzycki
Hi Harbs,

I've looked couple of times into the DropDownList from Basic. Maybe it's
time to reorganize things. Add there View, Model, Renderers etc ? I did
that for MDL DropDownList.

Thanks, Piotr

2018-01-25 23:18 GMT+01:00 Gabe Harbs :

> The dataProvider setter in DropDownList has the following code:
>
> for (i = 0; i < n; i++) {
> opt = document.createElement('option') as
> HTMLOptionElement;
> if (lf)
> opt.text = value[i][lf];
> else
> opt.text = value[i];
> dd.add(opt, null);
> }
>
> Basically, it makes the assumption that the dataProvider is an
> index-accessible object. This is not the case if the dataProvider is a
> collection. In that case, the code should be something like this:
>
> opt.text = value.getItemAt(i)[lf];
> else
> opt.text = value.getItemAt(i);
>
> I’m not sure of the best way to generalize this.
>
> Thoughts?
> Harbs




-- 

Piotr Zarzycki

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


DropDownList with ArrayList

2018-01-25 Thread Gabe Harbs
The dataProvider setter in DropDownList has the following code:

for (i = 0; i < n; i++) {
opt = document.createElement('option') as HTMLOptionElement;
if (lf)
opt.text = value[i][lf];
else
opt.text = value[i];
dd.add(opt, null);
}

Basically, it makes the assumption that the dataProvider is an index-accessible 
object. This is not the case if the dataProvider is a collection. In that case, 
the code should be something like this:

opt.text = value.getItemAt(i)[lf];
else
opt.text = value.getItemAt(i);

I’m not sure of the best way to generalize this.

Thoughts?
Harbs