Actionscript 3 :: Creating Custom Item Renderers In Flex?

Jun 14, 2011

while creating custom item renderers which interfaces we need to implement?

View 2 Replies


Similar Posts:


Action Script 3 :: Custom Image Item Renderers?

Jun 25, 2009

I have a custom item renderer which displays a different gif in the row depending on data value from the data object. When i set the image source url using the absolute path and not embedding it works fine however when i embed the images i find that when i scroll up and down the grid the images get messed up and sometimes sit on top of each other. why embedding images in my hbox item renderer is causing so hassle;

code
public var equipment:Image;
public var compr_icons:Bitmap = new AssetManager.COMPUTER_ICON;

.. do some logic
equipment.addChild(compr_icons);

View 1 Replies

Flash - Enable Tab Key Navigation On A Datagrid Where The Cells Are Custom Item Renderers?

May 26, 2011

This is a snippet of code in our custom item renderer which is in actionscript:

textCustomItemRendererTempForTab.tabEnabled=true;
textCustomItemRendererTempForTab.focusEnabled=true;
textCustomItemRendererTempForTab.setFocus();
Alert.show( "Without this alert focus goes to next grid " );
keyboardEvent.preventDefault();
keyboardEvent.stopImmediatePropagation();
keyboardEvent.stopPropagation();

Right now tab navigation works (on tab, focus goes to next editable cell) with the alert inserted in the code but I'm not sure why because I believe the alert in the code breaks the flow of event bubbling. However without the alert (which is what we are going for) the focus goes to the next grid in our UI.

You can see the attempts of trying to stop the event from going to other components. I have also tried to call preventDefault() and stopPropagation() on the datagrid when it receives a tab key event.

how to allow proper tab key navigation without an alert?

View 1 Replies

Flex :: Use 2 Different Item Renderers In Mx:Tree?

Mar 20, 2010

How can I use multiple item renderers in mx:Tree depending on item's depth/level in tree?For example. For the first level items I want to use label with button and for second level items combobox

View 2 Replies

Flex :: Force All Item Renderers To CommitProperties?

Mar 5, 2010

I have an item renderer that checks an external source for display information. If that information changes, I want to force all item renderer instances to check it.

What's the best way for force all the item renderers in a list or grid to either commitProperties or execute some other method?

I've read that resetting the grid.itemRenderer property will make them all initialize. I've also received the suggestion to iterate recursively through all the grid's children and call invalidateProperties on all the UIComponents I find.

View 2 Replies

Flex :: Use Creation Complete In Item Renderers?

Nov 25, 2010

Can i use creation complete in item renderers, i have a data grid and i have kept every single cell as an item renderer. is it a good practice to use creation complete here. I fear events might fire up at wrong instances.

View 2 Replies

Flex :: Triggering Item Renderers On Hover With DataGrids

Sep 27, 2009

I've got a client who has a list of items on a Datagrid. When the row is clicked, it sends the user to another page with details of that item. The client wants the rows to act like HTML links, where the color is purple when the link has been previously visited and its normal color if the row hasn't been clicked in the past. I've accomplished this with item renderers and SharedObjects. The application loads the visited ids into an array on start and the item renderer colors the individual cells if that row had been visited.

The issue here is that the client also wants the text color in the rows to turn white when the user rolls over the row. Because the item renderer sets the color, it doesn't respond to the default stylesheet for the datagrid. I can make it turn white on rollover of an individual cell, but we need the whole row to do it. Is there a way to trigger a function in all the item renderers in the row, or is there a better way to accomplish this?

View 1 Replies

Flex :: Set Up Item Renderers To Have The Created Only If They Are Displayed On The Viewport?

Jan 24, 2011

I have data ItemRenderers with DataGroup, but I have many items, and it seems to me that DataGroup create all of them not only those few displayed on users screen, which takes time and resources.

View 1 Replies

Actionscript 3 :: Flex / Using Multiple Item Renderers In A List

Feb 23, 2011

I'm trying to have multiple item renderers in a list, as I have several different types of objects that I want to display. I tried creating a new class that extends ListBase, and adding override public function createItemRenderer with my code within this function. I then instantiate the new class and give it my array of data as its dataProvider, but createItemRenderer is never called within my new class,

View 2 Replies

Flex :: Avoid Loads Of 'if Statements' In Item Renderers?

Aug 8, 2011

I have an item renderer for a list containing an image, label and a checkbox.These are visible depending on the dataProvider property of the list.E.g if an image is a premium image then display the premium label, if an image is a favourite then display a star etc.The problem is i have a massive if statement, and this doesn't seem good practice.

View 1 Replies

Flex - Spark List Reusing The Wrong Item Renderers?

Feb 9, 2010

I have a List component using multiple item renderers determined by the itemRendererFunction. When I set the data the first time, it works as expected. Then, when I set the data a second time with new data, it doesn't call the itemRendererFunction and tries to reuse the current renderers even though they don't match the data.Once I scroll, the function is called and the correct renderers are used. I tried calling invalidateDisplayList and such prior to setting the data, but that didn't fix the problem.

View 3 Replies

Actionscript 3 :: Implement An Object Pool For Flex Data/Item Renderers

Oct 6, 2010

You can hook into the creation of Flex 4 item renderers easily enough (through itemRenderer, or itemRendererFunction) allowing you to pull renderers from a custom object pool, but how would you put those renderers back into the pool?

I understand that layout virtualization does a form of object pooling, but I'd like a way to hook in to that. For example, when an itemRendererFunction has been assigned to a data group with a virtualized layout, item renderer construction is indeed deferred, but the instances are not re-used - I'd like to be able to intervene there, if possible.

But even in the case of normal virtualized renderers (where the instances are re-cycled) it would still be useful to be able to manage the pool manually. Pools could be shared between data groups, for example, to reduce the initial buffer required to populate each group.

Is there any way to know when Flex discards an item renderer instance? I have a sinking feeling that there is just no reliable way to tell - even though perhaps there should be.

View 2 Replies

Flex :: Override The Column Item Renderers For The Datagrid Component Dynamically

Feb 24, 2011

I have a view component called viewBase where I defined a advanced datagrid with few item renderers for datagrid columns. Now I have a requirement where I need to use the same view viewBase component, but not required to use any item renderers.

how to override the itemrenderers which are declared in a view component?

View 1 Replies

Flex :: Error When The Scroller Of The Mx:Tree With Custom Renderers Is Scrolled?

Aug 24, 2010

I have created a custom multiline item renderer for mx:Tree component. Important to mention that my item renderer has two UITextFields in it. Sometimes (depends of the input data) only one of UITextFields must be shown, so when second UITextField is not needed I hide it and recalculate the height of my item renderer. According to my tests height is calculated properly.The problem occures when I do scroll of my tree. The error text is:

TypeError: Error #1010: A term is undefined and has no properties.
at mx.controls::List/adjustVerticalScrollPositionDownward()[E:dev4.0.0frameworksprojectsframeworksrcmxcontrolsList.as:1042]

[code].....

View 1 Replies

Flex :: Access TileList Item Index In A Custom Item Renderer?

Mar 4, 2011

<mx:itemRenderer>
<mx:Component>
<mx:Canvas>

[code]......

View 2 Replies

Actionscript 3 :: Refresh Item Renderers And Change Their State?

Feb 2, 2012

I have a list with time related data. the item renderers display this time. I would like to make the item renderers refresh their state/labels upon the tick of a timer.

to which event should I add a listener within the renderer, and how do I trigger such event from the list?

View 3 Replies

Flex :: Actionscript - Flex 4.6 - Custom Item Renderer - HTML Formatted Text?

Dec 7, 2011

ow do you display HTML formatted text in a Spark custom item renderer (Actionscript)?

Sample Code:

The html content in item.post_content displays as plain text in the IconItemRenderer messageFunction snippet below (which is just the default generated code for Icon Item renderer):

<s:itemRenderer>
<fx:Component>
<s:IconItemRenderer iconField="iconField"
iconWidth="64" iconHeight="64" labelField="post_title" messageFunction="getPost">

[code]...

View 1 Replies

Flex :: Unable To Select Custom Item Renderer?

Jul 25, 2009

I have made the following item renderer in mxml, but when I use it in a list for some reason I can not select it. Am I doing something wrong?

<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
horizontalScrollPolicy="off">
<mx:Script>

[code]......

View 2 Replies

Flex :: Call A Custom Event From An Item Renderer?

Jun 17, 2010

I have a Renderer:

<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" [code].............

View 5 Replies

Flex :: Forcing Custom Item Renders To Refresh?

Jul 4, 2010

I have an AdvancedDataGrid. One of the columns in the grid displayed with help of custom render. During the application run, I set another custom render to the same column.When I scroll data in the grid (change values for the custom renders) they display new view correctly.I want that they dispaly new view automatically (when I set them): so I think I have to call them and tell tham to refresh rgeir views.

View 1 Replies

Flex :: How To Add Spark List Item Custom Properties

Jan 3, 2011

I'm trying to make a simple flash application providing interface for taking tests as a high school assignment. One of the requirements is to use an XML file as data source.Now, having a List component bound to the XML file with questions consisting of data such as question body, question type (ie. single choice, multiple choice, open, image etc.) and possible answers (where applicable), I was wondering if I could add some additional data (and what is the best possible way to do so) to each question upon its transfer to the List component.

I am trying to achieve two main goals with this: firstly, to mark the questions to which an answer has already been given, like with such code in ItemRenderer class:
<s:Label color="{data.color}" text="{data.label}"/>
Where data.color would be set whenever the user gives an answer to a question.
Secondly, while at it, I thought of such possibility as a great way to store answers given to particular questions. In this case, the Class of the answer object would have been Object, since there has to be many type of questions (where the answer could also be a Bitmap for example).

View 2 Replies

Flex :: Custom Component First Item Not Read By Jaws

Jul 11, 2011

Flex application is being made accessibility compliant. When a custom component is made visible based on some condition, the first item (either text or formitem or textarea) inside the component is skipped by Jaws. It reads from the second item. On pressing UP arrow, the first item is then read. Is there a way to make the first item accessible without need for pressing UP arrow?

View 1 Replies

Flex :: Tree Custom Item Renderer Children Creation?

Oct 14, 2010

I have created a custom item renderer for the tree, i have added some children in create children function, my problem is that sometimes i need to show these children and sometimes i don't, depending on clicking on a button which also i have added at create children, the problem is that i had to create the item even if i don't want it to be visible, and removed it by making visible false, and this costs a lot of memory, i have tried to create it at buttons click listener but when scrolling the child disappears, and it may appear again if i keep scrolling up and down.. i am trying to add the child just when i need it to be visible, is this possible or i have to create it on child creation method?

View 1 Replies

Flex :: Print The Custom Item Renderer Images In Advanced Datagrids

Feb 23, 2011

we have developed a web application by using flex-blazeDS-Java. Now we got a requirement that to print the user existed page whenever he clicks on Print button. I am able to print my flex componets and advanced datagrid but not able to print the custom item renderer images which are rendered in datagrid. And also how to print the multiple pages when I have large data in advanced datagrid.

View 1 Replies

Flex :: Create A Custom List Item Renderer With Image(base64 Png String) At Runtime?

Mar 28, 2011

I'm trying to create a list with icons. There're a lot of examples but seems all of them are using embedded images.My problem is how can I create the list with icon from base64 png string at runtime?

View 1 Replies

Flex :: Creating Custom MXML Components?

Jun 21, 2010

When I define custom propertie in my MXML component, I also want to define a set of possible values of that property to make Flex Builder show then (possible values of the custom property) when I invoke code completion function.

View 2 Replies

Flex :: Creating A Custom List Component

Jan 10, 2011

I'm trying to extend the mx:Box container so that two buttons sit on the outside of the container to cycle through it's contents (similar to a scrollbar).

I've made a custom component that looks basically
like "mx:HBox->mx:Button mx:Box mx:Button" where the buttons and box are children of the hbox.

How do I offer the user access to the box (say its dataProvider and itemRenderer) through my custom component?

So they just need to write 'local:MyCustomComponent dataProvider="rar" itemRenderer="rar"/>' and my box inside that component can use it?

View 1 Replies

Flex :: Creating A Adobe Air Custom Statusbar

Apr 27, 2011

I've been looking for some examples on creating a custom statusbar for an AIR application, but haven't found anything really useful. That was until I started looking around in the Tour de Flex AIR app for an example, and it was right there (part of the app itself). Would anyone have some suggestions on replicating this statusbar. The trouble I'm having is that I cannot seem to get the value of a dynamic variable to display. I'm attempting to display the current user.

View 2 Replies

Actionscript 3 :: Using Image While Creating Custom Components In Flex?

Aug 25, 2010

For my AIR based application I am trying to create a custom component based on canvas which has an image (as shown below).

<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100" height="100" cornerRadius="5" borderStyle="solid" borderThickness="2" dropShadowEnabled="true" borderColor="#EDEDE8" dropShadowColor="#dddddd" shadowDistance="5" shadowDirection="center">

[Code].....

As a work around, I am trying to add an creationComplete listener to the canvas in my custom component and used to give titleImage.source = this.path . keep changing the image or when the path of the image fetched using some async call.

View 1 Replies

Flex :: Grid Renderers Updating Without UpdateDisplayList Being Called

Oct 14, 2010

I have an item renderer for a grid that has a fairly basic updateDisplayList function:

override protected function updateDisplayList( w : Number, h : Number ) : void
{
super.updateDisplayList( w, h );
var labelWidth : Number = Math.min( _labelDisplay.measuredWidth, w );

[Code]....

The next time I scroll the renders update to look like they should - but updateDisplayList is NOT called here (on the renderes). All that happens is that the renderers are re-positioned in the grid. Both the background and the label are displayed incorrectly initially so it's not just the label mis-behaving.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved