Item render
Hi All,
I have a datagrid and which should have the combobox in a
column and the data for the combobox should be passed from
httpservice
i tried with dataprovider to that combobox in datagrid but
its not accepting that it is giving some error
find me some solution for the problem
regards
Rajeev
Hi,
try:
<mx:DataGridColumn>
<mx:itemRenderer>
<mx:Component>
<mx:ComboBox>
<mx:dataProvider>
<mx:Array>
<mx:Object label="label 1"/>
<mx:Object label="label 2"/>
<mx:Object label="label 3"/>
<mx:Object label="label 4"/>
</mx:Array>
</mx:dataProvider>
</mx:ComboBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
or second way is (but I dont advice you):
arrStatus have to be defined in mxml component, where is your
DataGrid.
<mx:DataGridColumn>
<mx:itemRenderer>
<mx:Component>
<mx:ComboBox
dataProvider="{owner['parent'].arrStatus}"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
Similar Messages
-
Checkbox DataGrid Item Render Issue
I have a DataGrid component that has a column with a checkbox
item render. The code at the end of this post is identical to the
code at the bottom of the tutorial on this page:
Tutorial
The creation complete method calls a PHP function using the
AMFPHP framework. The PHP function returns an array of MySQL rows.
When I created the application initially, I was using the HTTP
Service component that would return the data as an XML list and
then Flex would bring it in as an Array Collection. The only thing
I changed was how the records were getting returned to Flex, which
is using AMFPHP. Now the item render does not function properly. If
the first record returned had a value of "true" then all the
subsequent rows would have their check boxes checked. If it were
"false" then the subsequent rows would have their check boxes
unchecked. Why is it doing this? It worked the way it was suppose
to before.
Also I have a label component nested in the itemRenderer to
see if it matches the data in the MySQL database; which it does
match. Here is a screenshot of what exactly I am seeing:
ScreenshotMaybe the values being returned must be cast to Boolean
now? -
Hi everyone
I have a datagrid and a combobox in one of the column so i am
using item render for that but i am unable to populate data
dynamically into that rendered combobox
how can i do that, plz find me some solution
Regards
RajeevWhere is the data for the combo box?
Tracy -
Option / Menu items render smaller 12 points in Chinese font problem
Doesn't anyone experience when JVM SWING render Chinese Font smaller than
12 points (say 9 points) very ugly in label, ...etc. Just not similar to Windows' one.
How to config it to work properly?
I find that menu items / option items both are rendered ugly in Star office
application / OpenOffice.Hi,
unfortunatly you cannot change the properties of Action object as you would do with JavaBeans. Instead you have to use the 'put' method.
eg.:
myAction.put(Action.SMALL_ICON, new ImageIcon(...));IMHO this was a bad decision, because it's not like the JavaBeans standard and you loose static type information. :-/
-Puce
Message was edited by:
Puce -
PrintDataGrid's DataGridColumn - Embedded image not printing when you use TextFlow in the item rende
I'm printing a datagrid using something like this...
<mx:PrintDataGrid
id="printDataGrid"
width="100%"
height="100%"
showHeaders="false"
borderVisible="false"
horizontalGridLines="false"
variableRowHeight="true"
dataProvider="{titles}"
>
<mx:columns>
<mx:DataGridColumn
itemRenderer="renderer.TitlePrintRenderer"
/>
</mx:columns>
</mx:PrintDataGrid>
TitlePrintRenderer.mxml has s:RichText component. I use RichText's textFlow property to render the text. The approach is working fine except that if the textFlow has embedded images (<img source=... />), the images are not printed!
Is this a bug? Is it a limitation? Has anyone come across this issue?
I'm using Flex SDK 4.5.1After struggling for 4+ days on using timer / events for printing PrintDataGrid with embedded images in RichText's textFlow, I tried your other suggestion... to convert <img> tags to InlineGraphicElement and give it Bitmap from image loaded from a .gif file. The approach works but the printout skips images in a few rows!
I've this test case in which, every time I print, it skips printing image in the second row! I also implemented this approach in a more complex test case and depending on the total number of rows, it would skip printing image in different number of rows. I'm suspecting that even if you construct InlineGraphicElement from bitmap loaded from an image, PrintDataGrid's renderer still skips printing image intermittently.
I would very much appreciate it if you could create small project from my following code and verify this behavior. I'm at my wit's end in getting this printing to work.
PrintImagesTest.mxml
=================
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955" minHeight="600"
initialize="initData();"
viewSourceURL="srcview/index.html"
>
<s:layout>
<s:VerticalLayout
paddingLeft="20" paddingRight="20"
paddingTop="20" paddingBottom="20"
/>
</s:layout>
<mx:Button
label="Print"
click="printClickHandler();"
/>
<fx:Script>
<![CDATA[
import flash.utils.setTimeout;
import flashx.textLayout.elements.InlineGraphicElement;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import mx.collections.ArrayCollection;
import mx.printing.*;
import mx.utils.OnDemandEventDispatcher;
public var contentData:ArrayCollection;
private var embeddedImages:ArrayCollection;
private var numberOfImagesLoaded:int;
public var printJob:FlexPrintJob;
public var thePrintView:FormPrintView;
public var lastPage:Boolean;
private var textFlowNS:Namespace = new Namespace("http://ns.adobe.com/textLayout/2008");
public function initData():void {
contentData = new ArrayCollection();
var page:int = 0;
for (var z:int=0; z<20; z++) {
var content:Object = new Object();
content.srNo = z+1;
content.contentText =
"<TextFlow whiteSpaceCollapse='preserve' xmlns='http://ns.adobe.com/textLayout/2008'>" +
"<span>some text</span>" +
"<img width='53' height='49' source='assets/images/formula.gif'/>" +
"</TextFlow>";
contentData.addItem(content);
public function printClickHandler():void {
convertToTextFlow();
private function convertToTextFlow():void {
embeddedImages = new ArrayCollection();
numberOfImagesLoaded = 0;
for each (var contentElement:Object in contentData) {
extractImageInfo(contentElement.contentText);
if (embeddedImages.length > 0) {
loadImage(embeddedImages.getItemAt(0).source);
} else {
printData();
private function extractImageInfo(contentText:String):void {
var textXml:XML = new XML(contentText);
var imageList:XMLList = textXml.textFlowNS::img;
for each (var img:XML in imageList) {
var embeddedImage:Object = new Object();
embeddedImage.source = String(img.@source);
embeddedImage.width = parseInt(img.@width);
embeddedImage.height = parseInt(img.@height);
embeddedImages.addItem(embeddedImage);
private function loadImage(imageSource:String):void {
var loader:Loader = new Loader();
var urlRequest:URLRequest = new URLRequest(imageSource);
loader.load(urlRequest);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
private function imageLoaded(e:Event):void {
embeddedImages.getItemAt(numberOfImagesLoaded).bitmap = (Bitmap)(e.target.content);
embeddedImages.getItemAt(numberOfImagesLoaded).width = ((Bitmap)(e.target.content)).width;
embeddedImages.getItemAt(numberOfImagesLoaded).height = ((Bitmap)(e.target.content)).height;
++numberOfImagesLoaded;
if (numberOfImagesLoaded < embeddedImages.length) {
loadImage(embeddedImages.getItemAt(numberOfImagesLoaded).source);
} else {
// all the images have been loaded... convert to textflow
buildContent();
printData();
private function buildContent():void {
var contentIndex:int = 0;
for each (var contentElement:Object in contentData) {
if (hasImage(contentElement.contentText)) {
buildTextFlow(contentElement, contentIndex);
++contentIndex;
private function buildTextFlow(content:Object, contentIndex:int):void {
var textXml:XML = new XML(content.contentText);
var p:ParagraphElement = new ParagraphElement();
for each(var child:XML in textXml.children()) {
switch (child.localName()) {
case "span":
var span:SpanElement;
span = new SpanElement();
span.text = child;
span.fontSize = 10;
p.addChild(span);
break;
case "img":
var image:InlineGraphicElement;
image = new InlineGraphicElement();
image.source = embeddedImages.getItemAt(contentIndex).bitmap;
image.width = embeddedImages.getItemAt(contentIndex).width;
image.height = embeddedImages.getItemAt(contentIndex).height;
p.addChild(image);
break;
content.textFlow = new TextFlow();
content.textFlow.addChild(p);
private function hasImage(contentText:String):Boolean {
var textXml:XML = new XML(contentText);
var imageList:XMLList = textXml.textFlowNS::img;
if (imageList.length() > 0) {
return true;
} else {
return false;
private function printData():void {
printJob = new FlexPrintJob();
lastPage = false;
if (printJob.start()) {
thePrintView = new FormPrintView();
addElement(thePrintView);
thePrintView.width=printJob.pageWidth;
thePrintView.height=printJob.pageHeight;
thePrintView.printDataGrid.dataProvider = contentData;
thePrintView.showPage("single");
if(!thePrintView.printDataGrid.validNextPage) {
printJob.addObject(thePrintView);
} else {
thePrintView.showPage("first");
printJob.addObject(thePrintView);
while (true) {
thePrintView.printDataGrid.nextPage();
thePrintView.showPage("last");
if(!thePrintView.printDataGrid.validNextPage) {
printJob.addObject(thePrintView);
break;
} else {
thePrintView.showPage("middle");
printJob.addObject(thePrintView);
removeElement(thePrintView);
printJob.send();
]]>
</fx:Script>
</s:Application>
FormPrintView.mxml
===============
<?xml version="1.0"?>
<mx:VBox
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:MyComp="myComponents.*"
backgroundColor="#FFFFFF"
paddingTop="50" paddingBottom="50" paddingLeft="50"
>
<fx:Script>
<![CDATA[
import mx.core.*
public function showPage(pageType:String):void {
validateNow();
]]>
</fx:Script>
<mx:PrintDataGrid
id="printDataGrid"
width="60%"
height="100%"
showHeaders="false"
borderVisible="false"
horizontalGridLines="false"
variableRowHeight="true"
>
<mx:columns>
<mx:DataGridColumn
itemRenderer="MyPrintRenderer"
/>
</mx:columns>
</mx:PrintDataGrid>
</mx:VBox>
MyPrintRenderer.mxml
=================
<?xml version="1.0" encoding="utf-8"?>
<s:MXDataGridItemRenderer
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:bslns="com.knownomy.bsl.view.component.*"
>
<s:layout>
<s:VerticalLayout
paddingLeft="5"
paddingRight="5"
paddingTop="3"
paddingBottom="3"
gap="5"
horizontalAlign="left"
clipAndEnableScrolling="true"
/>
</s:layout>
<fx:Declarations>
</fx:Declarations>
<s:HGroup
width="100%"
gap="5"
verticalAlign="middle"
>
<s:Label
text="{data.srNo}"
color="0x000000"
fontFamily="Verdana"
fontSize="10"
/>
<s:RichText
id="title"
width="700"
textFlow="{myTextFlow}"
color="0x000000"
fontFamily="Verdana"
fontSize="10"
/>
</s:HGroup>
<fx:Metadata>
</fx:Metadata>
<s:states>
<s:State name="normal" />
<s:State name="hovered" />
<s:State name="selected" />
</s:states>
<fx:Script>
<![CDATA[
import flashx.textLayout.elements.TextFlow;
[Bindable]
private var myTextFlow:TextFlow;
override public function set data(value:Object) : void {
if (value != null) {
super.data = value;
myTextFlow = data.textFlow;
]]>
</fx:Script>
</s:MXDataGridItemRenderer> -
hello guys i have an item renderer
like so
<mx:Component>
<mx:HBox width="100%" height="70" paddingLeft="0" paddingRight="0">
<mx:Image id="gb" source="assets/Warning.png" enabled="true" alpha="1" click="outerDocument.ShowPidmHideDuplicate();" useHandCursor="true" buttonMode="true"/>
<mx:Text id="stext" text="{data.fwvitals_messageA}"
fontFamily="
Georgia" fontSize="
14" fontWeight="bold" />
<mx:Image id="his" source="assets/history.png" enabled="true" alpha="1" useHandCursor="true" buttonMode="true"/>
</mx:HBox>
</mx:Component>
I would like to access the image in the item renderer so i can change it to something else using actionscript 3.0 does anyone know how does one go about doing this?Hi miguel,
You can access the image in your itemRenderer the following way by writing the ActionScript block within the itemRenderer...
<mx:itemRenderer>
<mx:Component>
<mx:HBox width="100%" height="70" paddingLeft="0" paddingRight="0">
<mx:Script>
<![CDATA[
private function changeImage():void
gb.source = "assets/Warning1.png";
his.source = "assets/history1.png";
]]>
</mx:Script>
<mx:Image id="gb" source="assets/Warning.png" enabled="true" alpha="1" click="outerDocument.ShowPidmHideDuplicate();" useHandCursor="true" buttonMode="true"/>
<mx:Text id="stext" text="{data.fwvitals_messageA}" fontFamily="Georgia" fontSize="14" fontWeight="bold" />
<mx:Image id="his" source="assets/history.png" enabled="true" alpha="1" useHandCursor="true" buttonMode="true"/>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
You can call the function changeImage() either on a button click or any event you want to chnage the source of image..
If this post answers your question or helps, please kindly mark it as such.
Thanks,
Bhasker Chari -
Hi all,
How can I put a comboBox inside a datagrid?
I want to set the comboBox with their own dataprovider and
the id should
pass to the datagrid fill at the save time.
I try this but doesnt let me to include a dataprovider.
Any links??
please help and thank you in advance.
<mx:DataGridColumn headerText="Status" dataField="Status"
>
<mx:itemRenderer>
<mx:Component>
<mx:VBox>
<mx:ComboBox id="{arrStatus}"></mx:ComboBox>
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
arrStatus is an array which will have a collection of
different statusHi,
try:
<mx:DataGridColumn>
<mx:itemRenderer>
<mx:Component>
<mx:ComboBox>
<mx:dataProvider>
<mx:Array>
<mx:Object label="label 1"/>
<mx:Object label="label 2"/>
<mx:Object label="label 3"/>
<mx:Object label="label 4"/>
</mx:Array>
</mx:dataProvider>
</mx:ComboBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
or second way is (but I dont advice you):
arrStatus have to be defined in mxml component, where is your
DataGrid.
<mx:DataGridColumn>
<mx:itemRenderer>
<mx:Component>
<mx:ComboBox
dataProvider="{owner['parent'].arrStatus}"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn> -
Item Renderer in Advanced Data Grid
I have checkbox against each folder in the datagrid and
binded to XMLListCollection. When the value in the field is true, i
want that checkbox to be selected. Its not working. Here is the
code. I want to know how item render is working in AdvancedDataGrid
Thanks in advance.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="vertical">
<mx:Script>
<![CDATA[
import mx.collections.HierarchicalData;
import mx.collections.XMLListCollection;
]]>
</mx:Script>
<mx:XMLList id="dpHierarchyXML" >
<Clegs>
<Cleg name="Cleg1" sel="true">
<FlightLeg createdDate="10/10/2008"
effectiveDate="10/10/2008"
endDate="10/10/2008" modifiedDate="10/12/2008"
station="ATL" carrier="Delta"
flightNo="9W756" acType="122"
beginDate="10/10/2008" timeRange="10"
doop="123" region="XYZ"
year_duration="0.24" moons="0"
cost="1250"
/>
</Cleg>
<Cleg name="Cleg2" sel="true">
<FlightLeg createdDate="10/10/2008"
effectiveDate="10/10/2008"
endDate="10/10/2008" modifiedDate="10/12/2008"
station="ATL" carrier="Delta"
flightNo="9W756" acType="122"
beginDate="10/10/2008" timeRange="10"
doop="123" region="XYZ"
year_duration="0.24" moons="0"
cost="1250"
/>
</Cleg>
</Clegs>
</mx:XMLList>
<mx:AdvancedDataGrid
id="adg"
dataProvider="{new HierarchicalData(dpHierarchyXML.Cleg)}"
rowCount="20"
width="100%"
treeColumn="{leg}"
variableRowHeight="true"
wordWrap="true" dropEnabled="true" dragEnabled="true"
dragMoveEnabled="true" sortExpertMode="true"
>
<mx:columns>
<mx:AdvancedDataGridColumn dataField="@sel"
headerText=" " width="25" rendererIsEditor="true"
editable="true" editorDataField="selected" />
<mx:AdvancedDataGridColumn dataField="@name" id="leg"
headerText="cLeg" />
<mx:AdvancedDataGridColumn dataField="@createdDate"
headerText="Created Date" />
<mx:AdvancedDataGridColumn dataField="@effectiveDate"
headerText="Effective Date" />
<mx:AdvancedDataGridColumn dataField="@endDate"
headerText="End Date" />
<mx:AdvancedDataGridColumn dataField="@modifiedDate"
headerText="Modified Date" />
<mx:AdvancedDataGridColumn dataField="@station"
headerText="Station" />
<mx:AdvancedDataGridColumn dataField="@carrier"
headerText="Carrier" />
<mx:AdvancedDataGridColumn dataField="@flightNo"
headerText="Flight No" />
<mx:AdvancedDataGridColumn dataField="@acType"
headerText="Account Type" />
<mx:AdvancedDataGridColumn dataField="@beginDate"
headerText="Begin Date" />
<mx:AdvancedDataGridColumn dataField="@timeRange"
headerText="Time Range" />
<mx:AdvancedDataGridColumn dataField="@doop"
headerText="DOOP" />
<mx:AdvancedDataGridColumn dataField="@region"
headerText="Region" />
</mx:columns>
<mx:rendererProviders>
<mx:AdvancedDataGridRendererProvider columnIndex="0"
columnSpan="1" depth="1" renderer="mx.controls.CheckBox">
</mx:AdvancedDataGridRendererProvider>
</mx:rendererProviders>
</mx:AdvancedDataGrid>
</mx:Application>2) You do not set an item editor only an item renderer.
<mx:AdvancedDataGridRendererProvider columnIndex="0"
columnSpan="1" depth="1" renderer="mx.controls.CheckBox">
3) You do not have rendererIsEditor on any columns that I can
see.
<mx:AdvancedDataGridColumn dataField="@sel"
headerText=" " width="25" rendererIsEditor="true"
editable="true" editorDataField="selected"/>
If I use the itemrender for that column, i am gettting the
check box for all the rows. Which i dont want . I want check box
only for the folder node. so i am using renderer provider
I want only one column to be editable -
How to accessing item renderers in action script??
Hi
I am working on itemrenderes in Flex!
I have link button component as item renderer inside one of the data grid column, please find my piece as below!
Now how do we make that item render invisible once we click on it!
We need to make that link button invisible to the user!
Let me know how to access like this!
public function onClick():void {
// we use our custom component as the template for the popup window
var confirmWindow:TitleWindow = TitleWindow(PopUpManager.createPopUp(this, ConfirmationPopUp, true));
// you will only need to take care of the yes response since you don't have to do anything
// if the response was a no
confirmWindow.addEventListener("selectedYes", function():void {
//Alert.show("Can be Upgraded to an Alarm");
upGradeEventToAnAlarm();
confirmWindow.addEventListener("selectedNo", function():void {
public function upGradeEventToAnAlarm():void
eventRO = new RemoteObject();
eventRO.destination = "eventBrowser";
eventRO.upGradeEventToAlarm.addEventListener("result",getResultHandler);
eventRO.addEventListener("fault", getFaultHandler);
eventRO.upGradeEventToAlarm(eventsDataGrid.selectedItem.id);
private function getResultHandler(event:ResultEvent):void
//eventsDataGrid.dataProvider.removeItemAt(eventsDataGrid.selectedIndex)
if(event.result == true)
Here I need to access the link button which is clicked and need to make invisible
Alert.show("Successfully Upgraded to an alarm");
else
Alert.show("Cannot be Upgraded to an alarm");
//Fault Handler.
private function getFaultHandler(event:FaultEvent):void
Alert.show(event.fault.faultString, 'Error');
]]>
</mx:Script>
<mx:TabNavigator x="24" y="25" width="95%" height="90%"
styleName="MyTabNavigator" horizontalGap="-20" backgroundColor="#e6e4e5">
<mx:Canvas label="View" width="100%" height="100%" >
<mx:DataGrid id="eventsDataGrid" dataProvider="{myModel.eventsList}"
height="90%" width="98%" x="10" y="23" >
<mx:columns>
<!-- <mx:DataGridColumn id="iconFlagID" headerText="IconFlag"
dataField="iconFlag" visible="false"/>-->
<mx:DataGridColumn headerText="EventID" dataField="id" visible="false"/>
<mx:DataGridColumn headerText="Event Name" dataField="eventName"/>
<mx:DataGridColumn id="catFieldId" headerText="Category"
dataField="category"/>
<mx:DataGridColumn headerText="AlarmName" dataField="alarmName"/>
<mx:DataGridColumn headerText="Severity" dataField="severity"/>
<mx:DataGridColumn headerText="Source" dataField="source"/>
<mx:DataGridColumn headerText="Updated Time" dataField="updateTime"/>
<mx:DataGridColumn headerText="Description" dataField="description"/>
<mx:DataGridColumn id="upgradeLinkButtonId"
headerText="Upgrade To Alarm" dataField="iconFlag">
<mx:itemRenderer>
<mx:Component>
<mx:Box height="100%" width="100%">
<mx:LinkButton id="eventsLinkButtonID" textDecoration="underline"
icon="@Embed(source='assets/eventsBrowser/images[97]1.JPG')"
click="outerDocument.onClick();" visible="{!data.iconFlag}"
textAlign="center" includeInLayout="true">
</mx:LinkButton>
</mx:Box>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
Thanks in advance
Aruna.S.N.Hi Prashant
Thanks for your reply!
But where my viewStack need to be declared??
Is it inside dataGridColumn if so its giving error as comonent declaration is not allowed here!
Tell me how to go about!
Thanks in advance
Aruna.S.N. -
Receiving live Feedback from aerender about render progress
Hey guys,
i have been wrangling with the terminal and applescript to have user commands pass from an UI script in after effects to the aerenderer. I already got something cool that starts renders for opened projects and sends email summaries after the render is done.
What the whole thing is lacking is a live feedback about the render process within after effects. Not sure if this is even possible to achieve, but let me explain:
When you render a composition using the queue method, you see the progress of your render as it happens on a progress bar. With the aerender process, you only have the terminal window that is sort of showing a log file as it is being generated while the render progresses. However, if i start the aerender over the terminal by passing additional commands for the terminal via system.callSystem() that are not related to the aerender itself (like executing scripts after the render is done), i completely loose any feedback and the terminal window just displays the command that my script has put into it.
Naturally, that makes it impossible to see how a really long render is progressing. You might not notice if the render is stalling or not progressing. What i would like to have is a way of showing inside of after effects the progress, either as a rotating wheel animation with a current frame tag or something even more sophisticated. But this should not freeze the UI, as i want to continue working while the aerender is rendering.
Now i have been playing around in my head with this problem a lot. Let me explain what my concept would be:
In order to get feedback of the progress on a render's end, i output the terminal protocols of the rendering into a generallog.txt file (in order to make sure the log sits in the same location everytime) as they are being generated. From this text file, i can read things like total render time, item render time, item name, etc for a summary to email after the render.
I noticed that this .txt file is updated for each line of progress (meaning if frame 1 is done, a line will be added to the document "PROGRESS: 0:00:00:00 (1): 2 Seconds". Now one idea was having a script checking the content of this text file every second to see what frame has been rendered and then displaying this information. It could even look at the composition's timeline and compare the currently rendered frame number to the total comp length in order to create a progress bar of what is done already.
My concerns are: Would this be save enough? Would this mean a freeze of the UI (a refresh button could be a workaround)? Is there a more elegant way of doing something like this, maybe without any txt files?
Please, let me have your thoughts. I will of course post the result once i get something working.neat. here is the Adobe SendNow app I've never heard about.
I'd sure as hell rather be using this than yousendit! I've been paying them 50 bucks a month and don't enjoy the service at all.
this would be another good thing to have tied into our cloud homepages. you could see your file upload, confirm they got it. blah blah.
https://www.acrobat.com/sendnow/en/home.html
I think I'm closer to finding the basecamp thing.... maybe its called echosign... no.. workspaces? yes.
Adobe workspaces is the BaseCamp of Adobe that I was looking for.
https://workspaces.acrobat.com -
Dynamic datagrid rowHeight and itemRenderer problem
Hi guys,
Long time listener; first time caller....
I have had a look around the forums here and i can see there are a lot of similar issues to the one i'm currently having but not so many solutions. Not sure if i'll have any better luck with my question but here goes...
My issue is to do with the row height of a datagrid row not matching up properly with the height of the custom iterm renderer used on a column.
The item renderer consists of an HBox containing an image and a textArea. The image will not always be present and the text area can contain a couple of words or many lines of text.
I have overridden the measure function of the item render in which i am manually setting the HBox's height and measuredHeight.
Problem is that i have to find some way of triggering a redraw of the datagrid AFTER if have set the item renderers height, but i dont seem to be able to directly access the in-line renderer from the parent class.
If anyone could throw any suggestions my way it would be greatly appreciated!
thanks '
DaveOk so here's the sample code...
****Renderer*****
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox
horizontalAlign="
left" verticalAlign="
middle" horizontalGap="
0"verticalGap="
0"xmlns:mx="
http://www.adobe.com/2006/mxml" horizontalScrollPolicy="
off"verticalScrollPolicy="
off"width="
100%" height="
100%"resize="measure()"
borderColor="
green"borderStyle="
solid"
>
<mx:Metadata>[
Event(name="gridRowHeightChange", type="flash.events.Event")]
</mx:Metadata>
<mx:Script>
<![CDATA[
import mx.events.ResizeEvent;
import flash.events.Event;
Bindable] public var showLocalPartImage:Boolean = false;
override public function set data(value:Object):void
super.data = value;
lblPartNum.text = data.label;}
override protected function measure():void
super.measure();
if(lblPartNum.text != "" && lblPartNum.width > 0) {
lblPartNum.validateNow(); lblPartNum.mx_internal::getTextField().autoSize = TextFieldAutoSize.LEFT;
lblPartNum.height =
this.height = measuredHeight = lblPartNum.mx_internal::getTextField().height;
dispatchEvent(
new Event("gridRowHeightChange")); }
]]>
</mx:Script>
<mx:Image id="imgLocal" horizontalAlign="center" verticalAlign="middle" visible="false" width="{0}"/>
<mx:TextArea id="lblPartNum" width="{this.width - imgLocal.width - 4}" height="100%" editable="false" verticalScrollPolicy="off" />
</mx:HBox>
****EndRenderer*****
****DataGrid****
public function measureGrid(event:Event):void{
shoppingCart.removeEventListener(DataGridEvent.COLUMN_STRETCH, measureGrid);
shoppingCart.invalidateList();
shoppingCart.addEventListener(DataGridEvent.COLUMN_STRETCH, measureGrid);
<mx:DataGrid id="shoppingCart"width="
100%" height="100%"dataProvider="
{_order.orderItems}"allowMultipleSelection="
true"sortableColumns="
true"variableRowHeight="
true"doubleClickEnabled="
true"doubleClick="selectPartHandler(event)"
paddingRight="
5"editable="
false"
>
<mx:columns>
<mx:DataGridColumn width="22" minWidth="20" sortable="false" editable="false"/>
<mx:DataGridColumn width="22" minWidth="20" sortable="false" editable="false"/>
<mx:DataGridColumn minWidth="240" width="270" dataTipField="description" dataField="description" headerText="Description"editable="
false" wordWrap="true">
<mx:itemRenderer>
<mx:Component>
<controls:DescriptionShoppingCartRenderer showLocalPartImage="
{!(outerDocument.displayUnderline)}" gridRowHeightChange="{outerDocument.measureGrid(event)}">
</controls:DescriptionShoppingCartRenderer>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
****EndDataGrid****
Unfortunately the whole code is much too large to fit in here, but here are the main working parts.
I hope this helps.
What i am getting when running this is strange. When i run the first time and when i resize a column, the row height is incorrect, but then when i just click the 'column stretch' arrow (ie the space between the column headers) and dont actually resize at all, the row heights re-calculate and they fit perfectly.
This makes me think that i need to trigger this event manually AFTER the itemRenderer has been calculated.
EDIT: forgot to add the measureGrid function -
JComboBox rendering issue in JTable
I use a JComboBox to render certain items in my JTable.
When I use jdk1.3, the items render perfectly.
The problem is that when I use jdk1.4, the combobox is rendered with larger insets, clipping the bottom of the text.
Has anyone else had this problem?Okay - I can get the JComboBox and define an empty border for it. This means it renders okay.
What I don't like is stupid things like this creeping into jdk1.4 which weren't there in jdk1.3.
Thanks for the reply Rommie. -
ItemRenderer using ClassFactory
Hi,
I am having a problem using item render in a DataGrid using
ClassFactory.
I am using a custom item render. I have made this custom
itemrender implementing the IFactory Interface.
--MyItemRenderer.mxml--
<mx:Hbox implements="mx.core.IFactory">
<mx:Script>
[Bindable]
public var dataArray:ArrayCollection;
</mx:Script>
<mx:ComboBox id="combo" dataProvider="{dataArray}" />
</mx:HBox>
In the Application File
--MainApplication.mxml--
public var docCategoryComboEditor:ClassFactory;
docCategoryComboEditor = new ClassFactory(MyItemRenderer);
docCategoryComboEditor.properties =
{dataArray:documentCategories}
<mx:DataGrid id="dg"......
<mx:DataGridColumn
itemRenderer="DocumentCategoryComboRenderer"/>
</mx:DataGrid>
dg.verticalScrollPosition=2;
I have provided only the relvant code. To explain it short, I
am fetching DocumentCategories (Collection) using a remote object.
I am instantiating ClassFactory and setting a property
dataArray using the collection just fetched from the remoteobject.
In the dataGridColumn the itemRenderer is set to the instance
of the classFactory. Most of the things are working fine. But
problem comes when I execute the line which changes the
verticalScrollPosition. The exact error is mentioned in
http://www.mail-archive.com/[email protected]/msg50380.html.
It is having problems with listItems variable of ListBase. I
cannot exactly figure out the underlying problem. Please help.
Other way I can write
<mx:DataGridColumn itemRenderer="MyItemRenderer"/>
This works perfectly fine. But I need to pass some properties
to MyItemRenderer to make it a fully reusable itemrenderer.
If I put the above line, then I cannot pass any properties to
MyItemRenderer right? I will lose the flexibility.
Would appreciate any help on this.
Regards,
KishanI'll have to research this a little. I do know that using
your own ClassFactory can aid in passing in parameters to the
class. I just don't know this off the top of my head. I understand
what you are trying to do and it does make sense.
In the past when I've used a ComboBox in an itemRenderer, I
had the ComboBox's data right in with the data for the row. For
example, here's a row that might be for the selection of a color:
{ name:"Peter", color:{value:"Green",
db:["Red","Green","Blue"]}, value: 14}
So there are 3 fields: name, color, and value. The color
field is itself an object with 2 fields: value and db. The db field
is an Array to be used as the ComboBox's dataProvider.
In this way every row could have its own unique dataProvider.
Using this technique you can supply the same Array to every row and
have only 1 instance of the dataProvider shared by every
itemRenderer in the column.
But I'll check out the ClassFactory some more to see if that
will help you. -
PreventDefault MouseDown on a mobile IconItemRenderer
Hi,
I trying to cancel the mouseDown on custom itemrenderer that extends IconItemRenderer when it's on a certain state.
I add a state that named 'control'
_controlState = new State()
_controlState.name = 'control'
_controlOverride = new Array()
var requestAddChild:AddChild = new AddChild(this,_requestIndicator)
var controlAddChild:AddChild = new AddChild(this,_controlLabel)
var downEventHandler:SetEventHandler = new SetEventHandler(this,MouseEvent.MOUSE_DOWN)
downEventHandler.target = this
downEventHandler.handlerFunction = controlDownHandler
this.states.push(_controlState);
and the controlDownHandler function follow
protected function controlDownHandler (e:MouseEvent):void {
e.preventDefault()
e.stopPropagation()
//dispatchEvent(new DataRequestEvents(DataRequestEvents.DATA_REQUEST,true))
But the default MOUSE_DOWN event are not stoped. I've also tryed to simply add an EventListener.
I've alos tried to simply add an event listener inside overriden method createChildren:
this.addEventListener(MouseEvent.MOUSE_DOWN,controlDownHandler
protected function controlDownHandler (e:MouseEvent):void {
if (!dragging){
e.preventDefault()
e.stopPropagation()
//dispatchEvent(new DataRequestEvents(DataRequestEvents.DATA_REQUEST,true))
But, in this case, i can't drag the list up or down
Is there a way to reach this goal ?
Thank for helping .Hi Flex harUI!
I've a list that display the 12 more recent news.
My final goal is to add an itemRenderer at the end of the list that can call a service that get older news.
1- The classic item render with default MOUSE_DOWN event. (call another view)
2 -The added itemRenderer that preventDefault() and call the service
Everything work fine exept that i can avoid the MOUSE_DOWN event on this particular renderer. -
Embed Fonts in mobile IconItemRenderer
Hi everybody,
I developed a mobile app whose lists use a custom item render extended from the IconItemRenderer component.
Everything works fine except for the fonts. It does not display the right font, which is embedded via CSS.
Here is what the component does :
override public function set data(value:Object):void
super.data = value;
labelDisplay.setStyle("fontFamily", "MyFont");
labelDisplay.setStyle("fontWeight", "normal");
And this is my CSS
@font-face
src: url("../assets/fonts/MyFont.ttf");
fontFamily: "MyFont";
fontWeight: normal;
My item renderer keeps on displaying the default font.
Am I missing something ?
ThanksHi there,
Try taking a look at the following links:
http://www.trajiklyhip.com/blog/index.cfm/2007/7/18/Embedding-Fonts-in-Flex
http://blog.flexexamples.com/2007/10/25/embedding-fonts-from-a-flash-swf-file-into-a-flex- application/
Hope it helps.
With best regards,
Barna Biro
Maybe you are looking for
-
Can't choose column view in finder window
My view options in the finder window doesn't have a active hyperlink for the column view. It shows icon, list, cover flow, but not column. Does anyone know how to fix this?
-
Aleternative account no historical information
We have Alternative Accounts defined at Chart of account level ( COA A). These alternative accounts, have been assigned to our operating GL accounts defined under Operative Chart of Accounts ( COA B). Our Cleint is expected to see the Line item infor
-
E1EDS01 SUMID Qualifier for totals segment for shipping notification 004
Hi Guys, How to get this value in the Invoice output IDoc, i.e. this segment is missing in the Invoice Output IDoc. So could you help me in this. Regards, Kundan
-
How to implement FI-CA module in BI
Hi Experts, I am doing SAP BI project on FI-CA module.I have no idea about this module. please guide me how to implement this module thanks in Advance....youwill surley get points. regards ABHI
-
Tuxedo Migration - Memory issues
Dear All, We recently migrated our application as below Old Environment: 32 bit Tuxedo 8.1 on HPUX, Patch Level 371 New Environment: 64 bit Tuxedo 11.1.1.3.0 on Linux, Patch Level 006 After this migration our C++ Corba servers are leaking m