Hi Warren,

hope you get this example working. I fixed the same issue as yesterday in
List about min-height limiting the populist in combo, also added support
for itemRenderer at instance level. Is all committed in the repo. Code:

<j:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
xmlns:j="library://ns.apache.org/royale/jewel"
xmlns:js="library://ns.apache.org/royale/basic"
xmlns:html="library://ns.apache.org/royale/html"
xmlns:vos="vos.*">
<fx:Script>
<![CDATA[
import org.apache.royale.collections.ArrayList;
[Bindable]
private var loadStatusList:ArrayList = new ArrayList(['ALL','COMPLETED',
'NOTIFIED','ERROR', 'LOAD']);
]]>
</fx:Script>

<j:beads>
<js:ApplicationDataBinding/>
</j:beads>

<j:initialView>
<j:View>
<j:beads>
<js:Paddings padding="30"/>
<j:VerticalLayout gap="3"/>
</j:beads>
<html:H3 text="ComboBox Search"/>

<j:ComboBox height="16" labelField="label" dataProvider="{loadStatusList}"
itemRenderer="renderers.ComboRenderer">
<j:beads>
<j:ComboBoxPresentationModel rowCount="3" rowHeight="16"/>
<j:ComboBoxTextPrompt prompt="OPTIONS..."/>
</j:beads>
</j:ComboBox>
</j:View>
</j:initialView>

</j:Application>

Code for ComboRender:

<j:ListItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009";
xmlns:j="library://ns.apache.org/royale/jewel"
xmlns:js="library://ns.apache.org/royale/basic">

<fx:Script>
<![CDATA[
import vos.IconListVO;
[Bindable("dataChange")]
public function get iconList():IconListVO
{
return data as IconListVO;
}
]]>
</fx:Script>

<j:beads>
<js:ItemRendererDataBinding />
<j:HorizontalLayout gap="8" itemsVerticalAlign="itemsCenter"/>
<js:Paddings padding="0"/>
</j:beads>

<j:Label html="{text}"/>

</j:ListItemRenderer>

IconListVO (but icon is not used)

package vos
{
[Bindable]
public class IconListVO
{
public var label:String;
public var icon:String;

public function IconListVO(label:String, icon:String = null)
{
this.label = label;
this.icon = icon;
}
}
}

Now the combo can be more compact as you want, but still need some work to
make it look better. I'll work over it in the next few days.

I think I need to make it even more easy to configure this way since right
now it implies to make configs in more than one place, which is not
optimal. I always think of Jewel as a responsive UI set so to make it work
on desktop and also mobile, you should want the controls to be bigger so a
finger could touch on screen but also on desktop you can work easily with
the mouse pointer.

So this is really a new use case for Jewel that must be solved since until
now nobody tried it.

Hope you can work with it in the meanwhile to continue integrating your
pieces in your migration.

Carlos



El sáb., 24 oct. 2020 a las 18:45, Carlos Rovira (<[email protected]>)
escribió:

> Hi Warren,
>
> about Jewel ComboBox let's start trying to get the combo loaded with data.
> The following code should work for you to get the data you need with just
> 3 rows showing.
>
> I check that rowHeight is having the same problem as in the jewel list. I
> must exit now so I'll be looking at it tomorrow since for sure there is
> another bug that we need to solve.
>
> For now concentrate on getting this code working, that should be very
> straightforward.
>
> Thanks
>
> <j:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
> xmlns:j="library://ns.apache.org/royale/jewel"
> xmlns:js="library://ns.apache.org/royale/basic"
> xmlns:html="library://ns.apache.org/royale/html"
> xmlns:vos="vos.*">
> <fx:Script>
> <![CDATA[
> import org.apache.royale.collections.ArrayList;
>
> [Bindable]
> private var loadStatusList:ArrayList = new ArrayList(['ALL','COMPLETED',
> 'NOTIFIED','ERROR', 'LOAD']);
> ]]>
> </fx:Script>
>
> <j:beads>
> <js:ApplicationDataBinding/>
> </j:beads>
>
> <j:initialView>
> <j:View>
> <j:beads>
> <js:Paddings padding="30"/>
> <j:VerticalLayout gap="3"/>
> </j:beads>
> <html:H3 text="ComboBox Search"/>
> <j:Label multiline="true">
> <j:html><![CDATA[<p>This <b>ComboBox</b> uses a <b>SearchFilter</b> bead
> to perform a local search in the <i>dataProvider</i>. The filter is
> decorated, and can be configured.</p>]]></j:html>
> </j:Label>
>
> <j:ComboBox labelField="label" dataProvider="{loadStatusList}">
> <j:beads>
> <j:ComboBoxPresentationModel rowCount="3"/>
> <j:ComboBoxTextPrompt prompt="OPTIONS..."/>
> </j:beads>
> </j:ComboBox>
> </j:View>
> </j:initialView>
>
> </j:Application>
>
> --
> Carlos Rovira
> Apache Member & Apache Royale PMC
> *Apache Software Foundation*
> http://about.me/carlosrovira
>
>

-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Reply via email to