Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
heavyg
Posts: 14
Registered: ‎03-03-2009
My Device: Not Specified

List truncates on selection

[ Edited ]

Having a problem with selection of lists in a Burrito app.  I have two lists on a page that initially display fine but as soon as I select an item from either list it cuts it off the label about half way.  I'm not doing any formating that I'm aware of on the label.  As an exaple if the item lable was "My Name" as soon as I selected it and ran the code below the label is trunicated to "My Na..." .

 

I don't think its the code since other events in the app also trigger it without problems, I'm guessing its a control issue.   Anyway thanks in advance ! - Gary

 

The code executed on a selection event:

 

function calculateResult(e:Event = null):void{
				fromVal = fromList.selectedItem.data;
				toVal = toList.selectedItem.data;
				//casting String to Number
				inputVal = Number(input_txt.text);
				
				//we want a "double" value here
				var nf:NumberFormatter = new NumberFormatter();
				nf.useThousandsSeparator = true;
				nf.precision =2;
				var result:String = nf.format(5426)
				
				//display the rates selected
				lblFromRate.text = "Selected From Rate : " + fromVal.toString();
				lblToRate.text = "Selected To Rate : " + toVal.toString();
				
				//calculating the result
				calculatedVal = inputVal * (fromVal / toVal);
				//adding the result to the text field
				result_txt.text = nf.format(calculatedVal.toString());
			}

 

The mx list control control:

 

<s:List id="fromList" x="37" y="184" width="450" height="230" minWidth="0" maxWidth="450"
			fontSize="15"></s:List>

 

 

Please use plain text.
Contributor
heavyg
Posts: 14
Registered: ‎03-03-2009
My Device: Not Specified

Re: List truncates on selection

So no one else is seeing this? Just entered a bug on it, not sure where it will end up.

Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: List truncates on selection

hey,

 

im not familiar with flex but, is there a way to check the width of the specific list item before and after you click on it to see if the inner width changes?

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.
Contributor
heavyg
Posts: 14
Registered: ‎03-03-2009
My Device: Not Specified

Re: List truncates on selection

Thanks for the sugestion.  I was thinking of trying the same thing.  Can't find anything specific as you would expect like in a .net control.  I may resort to creating a debug function and count the characters.  There is a truncateToFit="true"  but its only for labels and not lists.  Doesn't seem to make a lot of sense

Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: List truncates on selection

hey heavyg,

 

i think i may have found something. if you want access to the formatting of the inner items of the list, you should look into the itemRenderer component of the list. here is an example pulled out of the adobe ASDocs:

 

 

            <s:List id="list" changing="selectionChangingHandler(event);">
<!-- itemRenderer is inline in this sample -->
<s:itemRenderer>
<fx:Component>
<s:ItemRenderer>
<s:states>
<s:State name="normal" />
<s:State name="hovered" />
<s:State name="selected" />
</s:states>
<s:Rect left="0" right="0" top="0" bottom="0">
<s:fill>
<s:SolidColor color="0x999999" alpha="0" alpha.hovered="0.2"
alpha.selected="0.6" />
</s:fill>
</s:Rect>
<s:Label id="nameLabel" text="{data.lastName}, {data.firstName}" top="5" left="5" right="5" />
<s:Label y="20" id="phoneLabel" text="{data.phone}" includeIn="selected" top="25" bottom="5" left="5" right="5" />
</s:ItemRenderer>
</fx:Component>
</s:itemRenderer>
<s:dataProvider>
<s:ArrayList>
<fx:Object type="hr" firstName="Ann" lastName="Green" />
<fx:Object type="employee" firstName="Tom" lastName="Smith" phone="415-155-1212" />
<fx:Object type="employee" firstName="John" lastName="Black" phone="408-344-1234" />
<fx:Object type="employee" firstName="Jane" lastName="White" phone="415-235-7878" />
<fx:Object type="employee" firstName="Bill" lastName="Jones" phone="415-875-7800" />
</s:ArrayList>
</s:dataProvider>
</s:List>

 

from the looks of it it will give you the access you need to format your list items. hope that will get you where you want to be. good luck!

 

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.
New Contributor
gesrat17
Posts: 2
Registered: ‎02-09-2011
My Device: Not Specified

Re: List truncates on selection

I get the same behavior as well.  It doesnt happen if you run with the "desktop" target selected, but does occur if you run with the "device" target selected.  I'm using the MobileIconItemRenderer class for the list items

Please use plain text.
New Contributor
ollieollie82
Posts: 6
Registered: ‎01-19-2011
My Device: Not Specified

Re: List truncates on selection

this is definitely an issue as I'm seeing it even with the standard Adobe AIR employee directory apps and my own spark list items.

 

can you reference me to the bug you filed?  I would like to keep track of its status

Please use plain text.
New Contributor
jmgreen
Posts: 4
Registered: ‎02-21-2011
My Device: Not Specified

Re: List truncates on selection

[ Edited ]

Yeah, I'm seeing the same thing even in the sample "create an app in 90 minutes" tutorial provided.  It's only happening on VM, and it seems that it's replacing the last 2 letters of a word with ellipses.

 

For example:

"Amy Jon..."  instead of "Amy Jones"    or "call offi..." instead of "call office"

Please use plain text.