ActionScript 3.0 :: Flex - Complexity Of ItemRenderers In Lists
May 14, 2008
I'm building fairly simple item renderers, in fact, here's the code for one of them...
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
implements="mx.controls.listClasses.IListItemRenderer"
[Code].....
It's a really simple renderer that has an image and some text sitting next to it, or just the text if no image is in that item's data provider. There is also some basic rollover, rollout and click functionality...
So my question: Why is it that if my list needs to scroll it gets messed up? By "messed up" I mean that the text changes from being to the right of the image (when image is present) to moving over top of the image, as if it isn't realizing that the image is there. There's also sometimes an issue of the item renderer shrinking down so there is no longer anything even visible in the box (just some black with a grey border on the bottom about 5 - 10 pixels big...
I'm wondering if maybe my item renderer is too complex? I'm having the same issue with text working like that in another renderer, but no images, just text placed in certain positions (as well as some strage blue tints showing up at the top or bottom depending on how I am scrolling)
By the way... here is the MXML where I am initializing my list...
Code:
<mx:Canvas width="100%" height="100%" id="list">
<mx:List
width="100%"
[Code].....
View 1 Replies
Similar Posts:
May 5, 2011
Could tools like SWFAddress be used in some clever ways to alleviate an existing client-server architecture. I see possibilities to even introduce REST-like pattern mapping or something like that.
What I am currently doing is following all the Cairngorm guidleines, which has already led to a bunch of commands which all make sense, but inclusing the business delegates, and all that stuff, I am getting into a hard time extending and refactoring the application Anyway, what I thought of was somehow reducing the number of application events flying around, and the number of commands responding to them. Actualy, I am quite OK even coupling the view with some logic, if I can get rd of some layer complexity.
What I mean by that: perhaps, I could bind a button click to a url pattern (or use SWFaddress to change the url globally). On the other end, I wll be waiting for changes of the url, reformat it, and pass it onto a service delegate, which has the necessary mappings in mind, so it knows what method to call, or it could even pass the url directly to an HTTPSErvice. The delegate will then deal with the server response, and update the model, which through the bindings will update the view.
I am not going to completely ditch commands. I thing that they are good for scheduling of the internal interactions (within the client itself), but I'd like to abstain from using them for communication with the server.
View 1 Replies
Jan 18, 2012
To allow you to tab through itemrenderers in spark you simply set hasFocusableChildren="true". However when you tab to a row/tile which is not visible, it doesn't automatically scroll the List.
What's the easiest way of making this happen?
View 1 Replies
Apr 6, 2010
I have item renderers in an mx.controls.Tree that I need to refresh on demand.
I have code in the updateDisplayList that fires for only some of the visible nodes no matter what I do. I've tried triggering a change that they should all be listening for; I have tried clearing and resetting the dataProvider and the itemRenderer properties.
private function forceCategoryTreeRefresh(event : Event = null) : void
{
trace("forceCategoryTreeRefresh");
[Code]....
The nodes refresh properly when I scroll them into view (e.g. the .data gets set), but I cannot force the ones that already exist to refresh or reset themselves.
View 2 Replies
Jun 28, 2010
I'm creating a list of scores for a game. now most of the list i need to have the same ItemRenderer. but in one specific row of the list where the user who's playing is listed, it should show different information and with different background color. how can i achieve this ?
I already tried to resolve the issue with states, i created 2 states, one state called 'mine' and the 2nd state called 'others'.
the problems that i got is that when users click on one of the list rows that state changes to i donno clicked or something and that's why i assumed that states are not the right action for me.
View 3 Replies
Mar 22, 2011
I have a List class with an itemrenderer. How can I get the itemrenderers to divide the List width between them? Normally, I would think this would be a easy as giving the renderers a percent width but that no worky.
Application:
<?xml version="1.0" encoding="utf-8"?>
<s:Application
minHeight="600"[code]..............
View 1 Replies
Aug 4, 2011
I have following itemrenderer
[Code]...
My question is Should above logic go in updtaeDisplayList or remain in set data() itself. The output is smae from both. Whats the performance impact difference if we consider it from lifecycle perspective.(The heavy computations should be pushed towards the end of the frame rendering)
View 1 Replies
Oct 4, 2011
I've got a spark ListForm with a custom mxml itemRenderer,all the itemRenderer has is[code]...
View 1 Replies
Mar 13, 2012
In flex 4.5, I have an application that has a BorderContainer that loads a spark list (mxml style - _myList and the borderContainer is stored in a library outside of the parent application) that loads an arrayCollection with an itemRenderer (I should note said itemRenderer is not an inline renderer - on selection of an item in the list, the itemRenderer expands, loads a particular control within the item renderer based on data passed from the selected item in the list) and allows the user to perform a search. This works all well and good on startup/load, until I try to change the dataProvider for the list (my app allows users to switch data sources which then creates a new dataProvider with new variables). I have tried:
[Code]...
View 1 Replies
Jun 9, 2009
Basically I want to override some function in the flex/actionscript list class which creates a new ItemRenderer and passes it the required data ready to be displayed. I need to do this because I wish to show a different renderer based on the type of data being displayed. Is there such a function?
I don't really want to pass the list a single itemRenderer which calls its addChild function depending on the type of data it has - It just doesn't seem right.
View 1 Replies
Mar 20, 2012
A question about ItemRenderers: let's say I have an ArrayCollection that is my application data sitting inside a global object. I them populate a sparks list with this data, setting the ArrayCollection as the dataProvider.
So each ItemRenderer gets a copy of an item sitting in the array. You can override the "set data" method to set the data something more domain-specific. The problem is that the data is a copy of the original item.
Now let's say we want to add some data to the item while inside the ItemRender. For example, it could call a method on the item telling it to load some details about itself, or maybe we allow the user to modify something on the item.
Obviously, we can't do any of this if we are operating on a copy because it will be thrown away as soon as the ItemRenderer is destroyed and the original object doesn't know anything about what happened.
So what's the best practice? Should I just use the itemIndex of the renderer to pull out the original item from my global array like this:
{globalArrayCollection}.getItemAt(this.itemIndex) But it seems kind of clunky to me. Is there a best practice for dealing with this?
View 2 Replies
Feb 19, 2010
I'm developing on Flex 4. I have a datagrid container and custom itemrenderer with a text field, a button and a few boxes. Every time some data is displayed, the app stalls for a second or two before rendering completely. Is there any way to make it render more fluidly or render one after another...?
View 1 Replies
Dec 22, 2010
I've got a Flex 3 website. Unfortunately, Google Webmaster Tools lists zero keywords for my site. My site's been up for about a month. I submitted a sitemap. I've put a description and keywords metatags in the HTML wrapper.Any advise on what else I should do? Does anyone have a Flex 3 site for which Google Webmaster Tools lists keywords?
View 2 Replies
Aug 5, 2011
I'm trying to override the default handling of the 'up' and 'down' keys for an editable list, such that when they are pressed a list entry that is being edited behaves as if the escape key has been pressed, but the 'selected item bar' moves up or down.
Here is my (simplified) component:
<?xml version="1.0" encoding="utf-8"?>
<mx:List xmlns:mx="[URL]"
enabled="true" width="100%" height="100%"
creationComplete="initialise()"
editable="true"
[Code] .....
For some reason this doesn't work: if a row is being edited, the first 'up' (or down) keypress ends the edit and moves the bar. Further up or down keypresses have no effect, but if you click somewhere near the list it does start working. This makes me think it is a focus issue. Weirdly, if you hit escape the edit finishes and you can move up and down correctly. If the 'callLater' line is uncommented to try and make the list retain focus, the bar initially moves in the direction of the keypress but then moves back again and re-edits the original line!
View 2 Replies
Apr 10, 2012
I have several horizontal scrolling lists with differing item widths stacked inside a Vertical Group. On an item click all any selected item from the other lists will be cleared. When any of the lists are scrolled all the other lists should scroll exactly the same amount in the same direction, simalar to [URL]
The synced scrolling is throwing an undefined error and has crashed the adl(it is a mobile app) on one occasion. This happens only when I add more than 2 synced scrolling lists via event listeners.
So my question is: Can anyone see why this errors or is there a better way to achieve this type of horizontal scrolling multi-list, possibly a really wide data-grid or group of buttons inside a scroller?
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[Code]....
View 2 Replies
Aug 17, 2010
I'm trying to create a nested list in Flex which will dynamically resize to display all children when the data provider changes.
Here's a simplified example which illustrates the problem:
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Code].....
The list sizes remain static when items are added.
If I add variableRowHeight="true" to the outer list then the inner lists will correctly resize. But the outer list itself remains at a fixed size.
How can I have both lists resize automatically to display all children?
View 1 Replies
Jan 10, 2012
I've got a Gridcolumn in a Datagrid (Spark). The Column's dataprovider is a Number value that gets updated via Binding.Now, without an item renderer the cell displays the correct values.If I set an item renderer, I can't access the values in this renderer.My renderer looks like this, so nothing really do here (for now) but to trace the value, but the value is always NaN.
<?xml version="1.0" encoding="utf-8"?>
<s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" width="100%" height="100%" >[code].......
without the renderer, the column displays the correct values, so apparently the DefaultGridItemRenderer works fine.As requested, here is my Datagrid;
<s:DataGrid id="dataGrid" dataProvider="{_listItems}">
<s:columns>
<s:ArrayList>[code]..........
_listItems is an ArrayList with instances of a model class, which has (amongst others) a property called change of type Number.
View 1 Replies
May 20, 2009
I have swing application in which there is MS excel like functionality. User can enter data in the columns. Most of the columns are drop down lists, so use have to select from the list. Can this functionality be easily built in Adobe Flex or GWT? Second complexity is depending upon what value is selected in a column, another column should show only those items which are related to selected value of first column. Its not country city data but for simplicity I am taking this example.
For example, first column is country and the second column is city. So depending upon what country is selected the second column will show only cities under that country. Its not just two drop down list on a page, its dropdowns of a row in a grid strructure. Is this possible in Adobe Flex or GWT or anyother web UI framework apart from Swing?
View 2 Replies
Jan 24, 2009
The top half of the code works fine (the addChild parts...) however when i added the code for the bottom... the Child would never appear... and i added trace statements but i can't figure it out... the menu comes back false and the controller does change to 5
ActionScript Code:
function menucontrol() {
if (menuview == true) {
[code].......
View 4 Replies
Jun 19, 2010
filtering one list when an "Artist" is selected in the other..
I also want to play the next video when the "Next Video" button is selected..
Here is a link to an example with a few videos.. [URL]
View source is enabled so feel free to grab the code..
how to build this app step by step using Flash Catalyst and Flash BUilder..
Anyhow, I'm not just taking, I plan on giving back in a major way..
So if the "evangalists" aren't too busy with their datagrids showing the true power and ease of use that the Adobe Framework is capable of..
View 1 Replies
Jun 29, 2010
As the title suggests, what is the runtime complexity (eg, big-O) of the Sprite.contains method?
View 2 Replies
Nov 5, 2008
does anyone knows the "time complexity" of Dictionary class methods ? for example, is the ""get"" is an o(1) time complexity ?
[Code]...
and another question in the same topic, how does the Dictionary "generate" an 'equal function' & 'hashcode' (assuming same implementation as in java's HashMap) from the object passed as a key? is it efficient ?
View 2 Replies
Jul 22, 2011
Today I came across this question and I now have a sudden urge to find & complete similar challenges for ActionScript 3.Are there any resources specifically targeting AS3 which offer a level of complexity similar to the above? It'd be great to start really pushing the limits of my ActionScript skills.
View 3 Replies
Nov 22, 2011
I'm quite new to flex and ActionScript and I'd like to create a custom component acting as a calendar (using a Sprite), in which the calendar events are represented as rectangles the user can interact with (click to get information about the event, drag and drop for setting start and end dates...). It seems that using a subclass of DataGroup is a good way to do it, but some things are obscure to me.For example, how should I use the Sprite? as a child of the DataGroup? Also, the calendar events will be drawn using a custom ItemRenderer, and I will have to use a BasicLayout in my DataGroup, but where should I tell that an ItemRenderer should draw its rectangle in the Sprite at the corresponding (x,y) coordinates?
View 1 Replies
Jan 25, 2012
I have a list that has alternating item colors.
<s:List id="myList" change="selectionChanged(event)" alternatingItemColors="[0x000000, 0xFFFFFF]" dataProvider="{alResults}" itemRenderer="itemRenders.Results" width="100%"></s:List>
[code].....
View 1 Replies
Mar 17, 2005
Posible? like: product here..product here..produkt with extra info and so on like 1 row moreor 2 lines heheor just 1 productitem info here? Or.. as in columns?
View 1 Replies
Nov 12, 2009
How do you make a List control wrap around to a second column (or multiple columns)? let me know if there is a solution for this with the List control or some other Flex control.
For example, if you have one list with 42 items in it, but I want to cap the height of a list to 20 items; then instead of having one list with 42 items all the way down, I would have that list of items look like the equivalent of 3 adjacent lists: the first with 20 items, the second with 20 items, and the third with 2 items (which represent the original list of 42 items). [url]...
View 6 Replies
Jun 30, 2009
i need something in this script for make mask to all the menu now i stell don't understand why just last menu is mask i have var( i )Start from 0 to last number the menu example: last number menu is 9 so will mask just the menu number 9 i need not just to mask menu number 9 i need to all the menu menu loanding from xml and i make the script for linkage i tray so much for finish the problem for mask all but .... this is script:
[Code]...
View 9 Replies
Jun 30, 2009
What I have are basically two lists.
(using this one as an example)
Bear = 5
Cat = 3
Dog = 1
Bird = 2
And I have two corresponding arrays
Array1 = [5, 3, 1, 2]
Array2 = [Bear, Cat, Dog, Bird]
How can you reorder this by number? I know that you can use Array.sort, but how would I still be able to tie the name to the number? Like, if you use the sort method, it will give you [1, 2, 3, 5], but the other array would still be [Bear, Cat, Dog, Bird]. How could I make it so it ends up being [1, 2, 3, 5] and [Dog, Bird, Cat, Bear]? I was thinking of making something like [[Bear, 5], [Cat, 3], [Dog, 1], [Bird, 2]], but I'm pretty much stuck after that...
View 5 Replies
Jul 6, 2011
I need to create the same like this: [URL]
but in flash... I am fighting all week to create this, but I've lost...
View 0 Replies