[flexcoders] Re: Custom Component Height issue
this is a simple example, it might be useful. Basically, all i'm doing is increasing the panel height everytime i add a row into the datagrid. ?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 s:layout s:VerticalLayout horizontalAlign=center paddingTop=10/ /s:layout fx:Script ![CDATA[ import mx.collections.ArrayCollection; [Bindable] private var myDP:ArrayCollection = new ArrayCollection([ {col0:something, col1:0, col2:'goes', col3:'in', col4:'here'}, {col0:something, col1:0, col2:'goes', col3:'in', col4:'here'}, {col0:something, col1:0, col2:'goes', col3:'in', col4:'here'}, {col0:something, col1:0, col2:'goes', col3:'in', col4:'here'}, {col0:something, col1:0, col2:'goes', col3:'in', col4:'here'} ]); public function addRow():void { dg.dataProvider.addItem({col0:something, col1:0, col2:'goes', col3:'in', col4:'here'}); pnl.height += dg.rowHeight; //pnl.invalidateDisplayList(); // my test doesnt need this but yours might } ]] /fx:Script s:Button label=addRow click=addRow()/ s:Panel id=pnl title=panel width=400 height=250 s:DataGrid id=dg dataProvider={myDP} width=320 height=100% s:columns s:ArrayList s:GridColumn dataField=col0/ s:GridColumn dataField=col1/ s:GridColumn dataField=col2/ s:GridColumn dataField=col3/ s:GridColumn dataField=col4/ /s:ArrayList /s:columns /s:DataGrid /s:Panel /s:Application --- In flexcoders@yahoogroups.com, flexlearner19 flexlearner19@... wrote: no replies :( --- In flexcoders@yahoogroups.com, flexlearner19 flexlearner19@ wrote: hi all i am using a custom component (extended spark panel ,added some buttons on the header)and that contains a datagrid.now my problem is whenver I add a row to the datagrid,the panel is not updating it s height.So that i get a scrollbar in the datagrid. I need to avoid the scrollbar. any ideas to fix this ...please help..
[flexcoders] Re: right align the gridcolumn text
Thanks I went for Option 1 (using a custom item renderer) only because I couldn't get Option2 (extend ClassFactory) working. --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@... wrote: ClassFactory doesn't support setting styles; they're different than properties. You can get around this by either: 1) use a custom item renderer that has a styleName or css selector. 2) extend ClassFactory to support setting styles on the item renderer instances. See com.blogagic.core.UIComponentFactory at http://blogagic.com/_flex/libagic_source/srcview/index.html -TH --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: GridColumn doesn't have the textAlign style. Instead we can do this - s:GridColumn id=col dataField=etc s:itemRenderer fx:Component s:DefaultGridItemRenderer textAlign=right color=black/ .. How can I do this in actionscript? I've tried the following but doesn't work var renderer1:ClassFactory = new ClassFactory(DefaultItemRenderer); renderer1.properties = { textAlign:right, color:0xff00ff }; col.itemRenderer = renderer1; //doesnt work
[flexcoders] right align the gridcolumn text
GridColumn doesn't have the textAlign style. Instead we can do this - s:GridColumn id=col dataField=etc s:itemRenderer fx:Component s:DefaultGridItemRenderer textAlign=right color=black/ .. How can I do this in actionscript? I've tried the following but doesn't work var renderer1:ClassFactory = new ClassFactory(DefaultItemRenderer); renderer1.properties = { textAlign:right, color:0xff00ff }; col.itemRenderer = renderer1; //doesnt work
[flexcoders] spark datagrid drag drop question
Does anyone know if the drag drop functionality will feature in the next release of spark datagrid?
[flexcoders] Re: RTE when setting spark gridcolumn visible property (f
thanks for the clarification. --- In flexcoders@yahoogroups.com, Alex Harui aharui@... wrote: Even columns with visible=false get instantiated when declared in MXML. On 10/10/11 3:36 AM, bhaq1972 mbhaque@... wrote: Yes agreed. In our newer applications we do that. Just curious, if a column is defined as visible=false in mxml. That wouldn't be a memory consumption would it? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , valdhor valdhorlists@ wrote: If that is the use case I would have built that data grid and columns on the fly in ActionScript. Why bother having columns in memory that you don't use? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , bhaq1972 mbhaque@ wrote: The problem doesn't exist if the code is executed in the preintialize or creationComplete event. However, I didn't want to mention that because it takes the focus away from what looks like a bug in initialize. Why would one column give a runtime error and the other not? Halo datagrid doesnt have this problem. In our scenario, some columns have no relevance to certain customers. Instead of removing the column from the mxml, we store the column info (in this case make invisible) in the database. During the datagrid initialze we make it invisible. The creationcomplete event would be too late because by then the column would have rendered (for a split second). Preinitialize would be ok...but other parts of my code (unrelated to this problem) are failing because preinitialize is too early. i can't bare any more code rewrites(but i suppose it keeps me in a job). --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , valdhor valdhorlists@ wrote: The column probably hasn't been created yet. Try the creationcomplete event of the datagrid. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , bhaq1972 mbhaque@ wrote: I get a runtime error when I set the gridcolumn.visible property during a datagrid initialize event. There is no problem's if its the first gridcolumn. Looks like a bug? Can anyone suggest a workaround? s:DataGrid initialize=makeColumnInvisible() s:columns s:ArrayList s:GridColumn id=gc0 dataField=col0 headerText=col0/ s:GridColumn id=gc1 dataField=col1 headerText=col0/ .. public function makeColumnInvisible():void { gc1.visible = false; // causes a RTE gc0.visible = false; // doesnt give a problem .. RangeError: Error #1125: The index 1 is out of range 0. at spark.components.gridClasses::GridDimensions/setTypicalCellWidth()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridDimensions.as:1325] at spark.components.gridClasses::GridDimensions/columns_visibleChangedHandler()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridDimensions.as:1840] at spark.components.gridClasses::GridDimensions/columnsCollectionChanged()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridDimensions.as:1800] at spark.components::Grid/columns_collectionChangeHandler()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\Grid.as:4429] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at spark.components.gridClasses::GridColumn/set visible()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridColumn.as:1564] ... -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] Re: RTE when setting spark gridcolumn visible property (f
Yes agreed. In our newer applications we do that. Just curious, if a column is defined as visible=false in mxml. That wouldn't be a memory consumption would it? --- In flexcoders@yahoogroups.com, valdhor valdhorlists@... wrote: If that is the use case I would have built that data grid and columns on the fly in ActionScript. Why bother having columns in memory that you don't use? --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: The problem doesn't exist if the code is executed in the preintialize or creationComplete event. However, I didn't want to mention that because it takes the focus away from what looks like a bug in initialize. Why would one column give a runtime error and the other not? Halo datagrid doesnt have this problem. In our scenario, some columns have no relevance to certain customers. Instead of removing the column from the mxml, we store the column info (in this case make invisible) in the database. During the datagrid initialze we make it invisible. The creationcomplete event would be too late because by then the column would have rendered (for a split second). Preinitialize would be ok...but other parts of my code (unrelated to this problem) are failing because preinitialize is too early. i can't bare any more code rewrites(but i suppose it keeps me in a job). --- In flexcoders@yahoogroups.com, valdhor valdhorlists@ wrote: The column probably hasn't been created yet. Try the creationcomplete event of the datagrid. --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: I get a runtime error when I set the gridcolumn.visible property during a datagrid initialize event. There is no problem's if its the first gridcolumn. Looks like a bug? Can anyone suggest a workaround? s:DataGrid initialize=makeColumnInvisible() s:columns s:ArrayList s:GridColumn id=gc0 dataField=col0 headerText=col0/ s:GridColumn id=gc1 dataField=col1 headerText=col0/ .. public function makeColumnInvisible():void { gc1.visible = false; // causes a RTE gc0.visible = false; // doesnt give a problem .. RangeError: Error #1125: The index 1 is out of range 0. at spark.components.gridClasses::GridDimensions/setTypicalCellWidth()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridDimensions.as:1325] at spark.components.gridClasses::GridDimensions/columns_visibleChangedHandler()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridDimensions.as:1840] at spark.components.gridClasses::GridDimensions/columnsCollectionChanged()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridDimensions.as:1800] at spark.components::Grid/columns_collectionChangeHandler()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\Grid.as:4429] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at spark.components.gridClasses::GridColumn/set visible()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridColumn.as:1564] ...
[flexcoders] Re: RTE when setting spark gridcolumn visible property (f
Thanks I feel a bit stupid now because I just realized its only affecting IE6 ...which is obviously a very out of date browser. --- In flexcoders@yahoogroups.com, Alex Harui aharui@... wrote: I'm sure it is just a bug. Please file it. I would try doing it on creationComplete and follow up with a validateNow() call. On 10/6/11 1:11 AM, bhaq1972 mbhaque@... wrote: The problem doesn't exist if the code is executed in the preintialize or creationComplete event. However, I didn't want to mention that because it takes the focus away from what looks like a bug in initialize. Why would one column give a runtime error and the other not? Halo datagrid doesnt have this problem. In our scenario, some columns have no relevance to certain customers. Instead of removing the column from the mxml, we store the column info (in this case make invisible) in the database. During the datagrid initialze we make it invisible. The creationcomplete event would be too late because by then the column would have rendered (for a split second). Preinitialize would be ok...but other parts of my code (unrelated to this problem) are failing because preinitialize is too early. i can't bare any more code rewrites(but i suppose it keeps me in a job). --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , valdhor valdhorlists@ wrote: The column probably hasn't been created yet. Try the creationcomplete event of the datagrid. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , bhaq1972 mbhaque@ wrote: I get a runtime error when I set the gridcolumn.visible property during a datagrid initialize event. There is no problem's if its the first gridcolumn. Looks like a bug? Can anyone suggest a workaround? s:DataGrid initialize=makeColumnInvisible() s:columns s:ArrayList s:GridColumn id=gc0 dataField=col0 headerText=col0/ s:GridColumn id=gc1 dataField=col1 headerText=col0/ .. public function makeColumnInvisible():void { gc1.visible = false; // causes a RTE gc0.visible = false; // doesnt give a problem .. RangeError: Error #1125: The index 1 is out of range 0. at spark.components.gridClasses::GridDimensions/setTypicalCellWidth()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridDimensions.as:1325] at spark.components.gridClasses::GridDimensions/columns_visibleChangedHandler()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridDimensions.as:1840] at spark.components.gridClasses::GridDimensions/columnsCollectionChanged()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridDimensions.as:1800] at spark.components::Grid/columns_collectionChangeHandler()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\Grid.as:4429] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at spark.components.gridClasses::GridColumn/set visible()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridColumn.as:1564] ... -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] Re: RTE when setting spark gridcolumn visible property (f
The problem doesn't exist if the code is executed in the preintialize or creationComplete event. However, I didn't want to mention that because it takes the focus away from what looks like a bug in initialize. Why would one column give a runtime error and the other not? Halo datagrid doesnt have this problem. In our scenario, some columns have no relevance to certain customers. Instead of removing the column from the mxml, we store the column info (in this case make invisible) in the database. During the datagrid initialze we make it invisible. The creationcomplete event would be too late because by then the column would have rendered (for a split second). Preinitialize would be ok...but other parts of my code (unrelated to this problem) are failing because preinitialize is too early. i can't bare any more code rewrites(but i suppose it keeps me in a job). --- In flexcoders@yahoogroups.com, valdhor valdhorlists@... wrote: The column probably hasn't been created yet. Try the creationcomplete event of the datagrid. --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: I get a runtime error when I set the gridcolumn.visible property during a datagrid initialize event. There is no problem's if its the first gridcolumn. Looks like a bug? Can anyone suggest a workaround? s:DataGrid initialize=makeColumnInvisible() s:columns s:ArrayList s:GridColumn id=gc0 dataField=col0 headerText=col0/ s:GridColumn id=gc1 dataField=col1 headerText=col0/ .. public function makeColumnInvisible():void { gc1.visible = false; // causes a RTE gc0.visible = false; // doesnt give a problem .. RangeError: Error #1125: The index 1 is out of range 0. at spark.components.gridClasses::GridDimensions/setTypicalCellWidth()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridDimensions.as:1325] at spark.components.gridClasses::GridDimensions/columns_visibleChangedHandler()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridDimensions.as:1840] at spark.components.gridClasses::GridDimensions/columnsCollectionChanged()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridDimensions.as:1800] at spark.components::Grid/columns_collectionChangeHandler()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\Grid.as:4429] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at spark.components.gridClasses::GridColumn/set visible()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridColumn.as:1564] ...
[flexcoders] RTE when setting spark gridcolumn visible property (f
I get a runtime error when I set the gridcolumn.visible property during a datagrid initialize event. There is no problem's if its the first gridcolumn. Looks like a bug? Can anyone suggest a workaround? s:DataGrid initialize=makeColumnInvisible() s:columns s:ArrayList s:GridColumn id=gc0 dataField=col0 headerText=col0/ s:GridColumn id=gc1 dataField=col1 headerText=col0/ .. public function makeColumnInvisible():void { gc1.visible = false; // causes a RTE gc0.visible = false; // doesnt give a problem .. RangeError: Error #1125: The index 1 is out of range 0. at spark.components.gridClasses::GridDimensions/setTypicalCellWidth()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridDimensions.as:1325] at spark.components.gridClasses::GridDimensions/columns_visibleChangedHandler()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridDimensions.as:1840] at spark.components.gridClasses::GridDimensions/columnsCollectionChanged()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridDimensions.as:1800] at spark.components::Grid/columns_collectionChangeHandler()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\Grid.as:4429] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at spark.components.gridClasses::GridColumn/set visible()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\gridClasses\GridColumn.as:1564] ...
[flexcoders] Re: Using RemoteClass meta tag
I'm doing the same thing as you, I don't even cast my object and it still works. I did do a simple test using [RemoteClass] but I can't remember it sorry. I just saw it as different approaches in achieving the same end result. --- In flexcoders@yahoogroups.com, Nick Middleweek nick@... wrote: Hi, Am I right in thinking the [RemoteClass] meta tag is used for mapping ActionScript Objects to Server-Side Objects AND vice versa? I've been reading the Adobe docs and I can't figure out at what point the RemoteClass meta tag kicks in to aid conversion. Does anyone have a super simplified explanation of the process? For the record: I'm using WebOrb for .Net on a project - Existing services are working and we're generally calling a service using parameters but in the Responder's result() method our code is just casting var myObject : MyClass = evt.result.myObject as MyClass; Because it's using casting I can't see where the [RemoteClass] is actually of any use? Thanks, Nick
[flexcoders] Spark Datagrid / IGridItemEditor.save() issue when using the tab key
I have problem with the IGridItemEditor.save() method. According to the docs for save()...if the data isn't valid, then the data isn't saved and the editor is not closed. So I setup an example to test this, and its seems ok. However, once I enter valid data and hit the Tab key, I expect the next column to contain the itemEditor. Instead its the column after that (which isnt correct). Maybe i'm going about this the wrong way, so any advice would be great. -- heres a little example demonstrating the problem. ?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 s:layout s:VerticalLayout horizontalAlign=center paddingTop=10/ /s:layout !-- problem: select first cell ...enter rubbish...then enter valid value...then tab = this doesnt tab to the next cell instead it tabs to the next one after that. whats going on? -- fx:Script ![CDATA[ import mx.collections.ArrayCollection; [Bindable] private var myDP:ArrayCollection = new ArrayCollection([ {col0:something, col1:4, col2:'goes', col3:'in', col4:'here'}, {col0:maybe, col1:3, col2:'this', col3:'one', col4:'as well'}, {col0:what, col1:1, col2:'about', col3:'this', col4:'one'}, {col0:sean paul, col1:3, col2:'red', col3:'temperature', col4:'um'}, {col0:chaka demus, col1:3, col2:'green', col3:'and pliers', col4:'um'} ]); ]] /fx:Script s:Label text=Edit a cell in col0. Enter rubbish, then tab. This will highlight error. Then enter 'hello' and tab againI expect to tab to col1 not col2/ s:DataGrid id=dg editable=true dataProvider={myDP} width=50% s:columns s:ArrayList s:GridColumn dataField=col0 headerText=col0 s:itemEditor fx:Component s:DefaultGridItemEditor fx:Script ![CDATA[ override public function save():Boolean { if(this.value == hello) { this.textArea.errorString = ; super.save(); return true; } else { this.textArea.errorString = Please enter: hello; return false; } } ]] /fx:Script /s:DefaultGridItemEditor /fx:Component /s:itemEditor /s:GridColumn s:GridColumn dataField=col1 headerText=col1/ s:GridColumn dataField=col2 headerText=col2/ s:GridColumn dataField=col3 headerText=col3/ s:GridColumn dataField=col4 headerText=col4/ /s:ArrayList /s:columns /s:DataGrid /s:Application
[flexcoders] Re: Spark Datagrid selectedItem question
I managed to achieve what I want using a bit of code. If anyone's intersted. 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 s:layout s:VerticalLayout horizontalAlign=center paddingTop=10/ /s:layout !--I'm mimiking the row locking by using selectedIndex, caretChange, and a few colors -- fx:Declarations !-- Place non-visual elements(e.g., services, value objects) here -- /fx:Declarations fx:Script ![CDATA[ import mx.collections.ArrayCollection; import spark.events.GridCaretEvent; import spark.events.GridEvent; import spark.events.GridItemEditorEvent; [Bindable] private var myDP:ArrayCollection = new ArrayCollection([ {col0:something, col1:4, col2:'goes', col3:'in', col4:'here'},{col0:maybe, col1:3, col2:'this', col3:'one', col4:'as well'},{col0:what, col1:1, col2:'about', col3:'this', col4:'one'},{col0:sean paul, col1:3, col2:'red', col3:'temperature', col4:'um'},{col0:chaka demus, col1:3, col2:'green', col3:'and pliers', col4:'um'}]); private var savedRowIndex:int = -1; private function lockRow():void { dg.editable = true; this.savedRowIndex = dg.selectedIndex; dg.setStyle(rollOverColor, 0xff); dg.setStyle(caretColor, 0xff); dg.addEventListener(GridCaretEvent.CARET_CHANGE, dg_caretChangeHandler); } private function unlockRow():void { dg.editable = false; this.savedRowIndex = -1; dg.setStyle(rollOverColor, 0xCEDBEF); //default spark rollOverColor = 0xCEDBEF dg.setStyle(caretColor, 0xA8C6EE); //default spark selectionColor = 0xA8C6EE dg.removeEventListener(GridCaretEvent.CARET_CHANGE, dg_caretChangeHandler); } protected function dg_gridItemEditorSessionStartingHandler(event:GridItemEditorEvent):void { // If you tab to last editable column - I want to setFocus on the button if(event.rowIndex != dg.selectedIndex)//or may event.rowIndex == dg.selectedIndex+1 { event.preventDefault(); callLater(btn1.setFocus); return; } } protected function dg_caretChangeHandler(event:GridCaretEvent):void { // This handler gets called before gridClick...so I can use it to stay focused on one row if(this.savedRowIndex != -1) { dg.selectedIndex = this.savedRowIndex; return; } } ]] /fx:Script s:Label text=Select a row. The lock (or unlock) the row. You shouldn't be able to click (or tab) anything else/ s:DataGrid id=dg dataProvider={myDP} width=50% gridItemEditorSessionStarting=dg_gridItemEditorSessionStartingHandler(event) s:columns s:ArrayList s:GridColumn dataField=col0 headerText=col0/ s:GridColumn dataField=col1 headerText=col1/ s:GridColumn dataField=col2 headerText=col2/ s:GridColumn dataField=col3 headerText=col3/ s:GridColumn dataField=col4 headerText=col4/ /s:ArrayList /s:columns /s:DataGrid s:HGroup s:Button id=btn1 label=lock row click=lockRow() / s:Button id=btn2 label=unlock row click=unlockRow()/ /s:HGroup /s:Application --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@... wrote: We'd prefer to stay within the datagrid. --- In flexcoders@yahoogroups.com, Rishi Tandon rishitandon123@ wrote: Make a pop up window which include the searchable row based on some unique ID and then display the row field and data inside a form. After changing the field value, update the grid data provider with the changed row value. Sent from my iPhone On Aug 24, 2011, at 10:56 PM, Amy amyblankenship@ wrote: How would a user edit a row that is not selected? --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: How would I go about making the datagrid.selectedItem the ONLY editable row? A bit like making individual columns editable by setting GridColumn.editable. Thanks BH
[flexcoders] Re: Spark Datagrid selectedItem question
Let me elaborate (sorry I was trying to keep the question short and sweet). In my situation, we don't want our users to edit more than one row at a time. So the datagrid starts off uneditable. They select a row they wish to edit. They then click a button to 'edit' that row. Once editing is complete they then click a confirm button to commit their It all sounds a bit backward but my boss assures me its the best way for our users. --- In flexcoders@yahoogroups.com, Amy amyblankenship@... wrote: How would a user edit a row that is not selected? --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: How would I go about making the datagrid.selectedItem the ONLY editable row? A bit like making individual columns editable by setting GridColumn.editable. Thanks BH
[flexcoders] Re: Spark Datagrid selectedItem question
We'd prefer to stay within the datagrid. --- In flexcoders@yahoogroups.com, Rishi Tandon rishitandon123@... wrote: Make a pop up window which include the searchable row based on some unique ID and then display the row field and data inside a form. After changing the field value, update the grid data provider with the changed row value. Sent from my iPhone On Aug 24, 2011, at 10:56 PM, Amy amyblankenship@... wrote: How would a user edit a row that is not selected? --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: How would I go about making the datagrid.selectedItem the ONLY editable row? A bit like making individual columns editable by setting GridColumn.editable. Thanks BH
[flexcoders] Spark Datagrid selectedItem question
How would I go about making the datagrid.selectedItem the ONLY editable row? A bit like making individual columns editable by setting GridColumn.editable. Thanks BH
[flexcoders] GridColum.itemEditor errorString not showing
Why does the red error box not show when I have this DefaultGridItemEditor(dg.itemEditorInstance).errorString = error; but does show when I have this DefaultGridItemEditor(dg.itemEditorInstance).textArea.errorString = error;
[flexcoders] Spark TextInput text highlight colour
I have a very simple question about Spark TextInput. s:TextInput text=Highlight this text and see what color the text is focusedTextSelectionColor=black/ When I use focusedTextSelectionColor=black I want the the colour of the text to be white (like it is in flex 3 and lower) How do I achieve that? tia
[flexcoders] Re: How to remove the DateField textInput border?
no probs. my answer was based on flex 4 (i havent been using flex 3 for a long time) cheers --- In flexcoders@yahoogroups.com, Andriy Panas a.pa...@... wrote: There is no borderVisible style for DateField, it exists only for DateChooser, only in Flex 4 SDK and only in default skin theme Spark. -- Best regards, Andriy Panas or borderVisible : false;
[flexcoders] Compile error when trying to use an extended spark TextInput
I have created a very simple MyTextInput MyTextInput.mxml - ?xml version=1.0 encoding=utf-8? s:TextInput xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx fx:Declarations !-- Place non-visual elements (e.g., services, value objects) here -- /fx:Declarations /s:TextInput When I try using it in a Application I am getting the compile error - Multiple initializer values for default property, 'text', of type 'String' What am I missing? thanks testApp --- 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 xmlns=* MyTextInput/ /s:Application
[flexcoders] Re: Compile error when trying to use an extended spark TextInput
fyi. I'm using FlashBuilder (with Flex 4.1 upgrade). This was a very basic test just to highlight the problem. My actual extended TextInput has alot more code (it also has a child button which i use to open up a number of popup components) I'll try out your Actionscript component suggestion. Thanks (btw this component is in mxml because thats how I did it back in Flex 1) --- In flexcoders@yahoogroups.com, Andriy Panas a.pa...@... wrote: I cannot reproduce your issue in a normal case. I can reproduce your issue only in extreme case, e.g. local:MyTextInput text=textValue1 fx:StringtextValue2/fx:String /local:MyTextInput BTW, why extend from TextInput class in MXML? If there are no visual subchildren in your custom component, it's better to extend the class in solemn ActionScript. -- Best regards, Andriy Panas On 14 July 2010 13:41, bhaq1972 mbha...@... wrote: I have created a very simple MyTextInput MyTextInput.mxml - ?xml version=1.0 encoding=utf-8? s:TextInput xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx fx:Declarations !-- Place non-visual elements (e.g., services, value objects) here -- /fx:Declarations /s:TextInput When I try using it in a Application I am getting the compile error - Multiple initializer values for default property, 'text', of type 'String' What am I missing? thanks testApp --- 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 xmlns=* MyTextInput/ /s:Application
[flexcoders] Re: Compile error when trying to use an extended spark TextInput
Thanks Andriy I just got round to testing it as a ActionScript class and it worked. I'm very surprised it we cant create an mxml based TextInput component. but there you go. thanks bod --- In flexcoders@yahoogroups.com, Andriy Panas a.pa...@... wrote: I cannot reproduce your issue in a normal case. I can reproduce your issue only in extreme case, e.g. local:MyTextInput text=textValue1 fx:StringtextValue2/fx:String /local:MyTextInput BTW, why extend from TextInput class in MXML? If there are no visual subchildren in your custom component, it's better to extend the class in solemn ActionScript. -- Best regards, Andriy Panas On 14 July 2010 13:41, bhaq1972 mbha...@... wrote: I have created a very simple MyTextInput MyTextInput.mxml - ?xml version=1.0 encoding=utf-8? s:TextInput xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx fx:Declarations !-- Place non-visual elements (e.g., services, value objects) here -- /fx:Declarations /s:TextInput When I try using it in a Application I am getting the compile error - Multiple initializer values for default property, 'text', of type 'String' What am I missing? thanks testApp --- 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 xmlns=* MyTextInput/ /s:Application
[flexcoders] Re: How to remove the DateField textInput border?
or borderVisible : false; --- In flexcoders@yahoogroups.com, Andriy Panas a.pa...@... wrote: Have a look at textInputStyleName style http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/mx/controls/ComboBase.html#style:textInputStyleName - http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/mx/controls/ComboBase.html#style:textInputStyleName .textInputStyleName { border-skin : ClassReference(null); } mx:DateField textInputStyleName=textInputStyleName selectableRange={{rangeStart: new Date(2006,0,1), rangeEnd: new Date(2006,2,15)}}/ - -- Best regards, Andriy Panas On 13 July 2010 16:37, Nick Middleweek n...@... wrote: Hi, Has anyone been able to modify the border of the TextInput component of the Date field? I'm trying to set it to ZERO. I've tried extending the DateField - MyDateField and specifying the borderThickness in updateDisplayList using this.textInput.setStyle(borderThickness, 0); ... to be honest, I'm not even sure if that's the correct approach? is there a way to do it through code? Thansk in advance!! Nick
[flexcoders] Re: TabNavigator styles not being applied (flex4)
They look the same to me. I just added another style ... fontWeight:bold and that is being applied. Maybe I will use a skin Thanks --- In flexcoders@yahoogroups.com, Amy amyblankens...@... wrote: It looks like you're not using the mx namespace you've declared in your stylesheet. --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: Anyone know why styling is not being applied to this Flex4 example (a modified example from livedocs)? thanks 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 s:layout s:VerticalLayout verticalAlign=middle horizontalAlign=center/ /s:layout fx:Style @namespace s library://ns.adobe.com/flex/spark; @namespace mx library://ns.adobe.com/flex/mx; .myTabs { cornerRadius: 4; fillColors: #99, #cc; } /fx:Style s:Panel title=TabNavigator Container Example height=90% width=90% s:layout s:VerticalLayout paddingTop=10 paddingLeft=10 paddingRight=10 paddingBottom=10/ /s:layout mx:TabNavigator id=tn width=100% height=100% tabStyleName=myTabs s:NavigatorContent label=Panel 1 s:Label text=TabNavigator container panel 1/ /s:NavigatorContent s:NavigatorContent label=Panel 2 s:Label text=TabNavigator container panel 2/ /s:NavigatorContent s:NavigatorContent label=Panel 3 mx:Label text=TabNavigator container panel 3/ /s:NavigatorContent /mx:TabNavigator /s:Panel /s:Application
[flexcoders] TabNavigator styles not being applied (flex4)
Anyone know why styling is not being applied to this Flex4 example (a modified example from livedocs)? thanks 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 s:layout s:VerticalLayout verticalAlign=middle horizontalAlign=center/ /s:layout fx:Style @namespace s library://ns.adobe.com/flex/spark; @namespace mx library://ns.adobe.com/flex/mx; .myTabs { cornerRadius: 4; fillColors: #99, #cc; } /fx:Style s:Panel title=TabNavigator Container Example height=90% width=90% s:layout s:VerticalLayout paddingTop=10 paddingLeft=10 paddingRight=10 paddingBottom=10/ /s:layout mx:TabNavigator id=tn width=100% height=100% tabStyleName=myTabs s:NavigatorContent label=Panel 1 s:Label text=TabNavigator container panel 1/ /s:NavigatorContent s:NavigatorContent label=Panel 2 s:Label text=TabNavigator container panel 2/ /s:NavigatorContent s:NavigatorContent label=Panel 3 mx:Label text=TabNavigator container panel 3/ /s:NavigatorContent /mx:TabNavigator /s:Panel /s:Application
[flexcoders] VGroup and verticalScrollPolicy / horizontalScrollPolicy
I am trying to migrate Flex 3 mx:VBox verticalScrollPolicy=off horizontalScrollPolicy=off to a Flex4 s:VGroup However, VGroup does not have verticalScrollPolicy or horizontalScrollPolicy. What do I use, to ensure scrollBars don't show on my VGroup. Thanks
[flexcoders] Re: setting the border thickness on a Spark mx.controls.VBox ?
Or you might want click the Use Flex 3 compatibility mode checkbox under properties / compiler --- In flexcoders@yahoogroups.com, Peter DeHaan pdeh...@... wrote: If you're using Flex 4, I'd probably use the s:BorderContainer instead. It gives you a lot better control over the border settings. Peter From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Nick Middleweek Sent: Wednesday, June 23, 2010 12:15 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] setting the border thickness on a Spark mx.controls.VBox ? Hey Alex, I had my Flex 4 project set to use both Halo and Spark. I was using mx.controls.VBox but couldn't set the borderThickness. I ended up switching project to Flex 3.5 SDK and just sticking with mx.controls... so I've got round it but it'd be handy to know how to set a borderThickness on a VBox when using Spark + Halo under SDK v4... Is it possible? Cheers, Nick On 23 June 2010 17:07, Alex Harui aha...@...mailto:aha...@... wrote: Which theme? On 6/22/10 3:24 PM, Nick Middleweek n...@...http://n...@... wrote: Hi, Sounds a bit contradictory - Spark and mx.controls but I'm using Flex 4 but working on some Flex 3 code and can't update to Spark at the moment. I'm struggling to find out how to set the border thickness of my VBox to 10. Has anyone acheived this ? Thanks, Nick -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui -- Sent by Nick Middleweek ( { email: n...@...mailto:n...@..., mobile: +44(0)774 035 5424, blog: http://blog.middleweek.co.uk } );
[flexcoders] Re: Hai Ths Is Sridhar : Regarding Flex Plz Help Me
do a google on IFrame Alistair Rutherford this might help --- In flexcoders@yahoogroups.com, sridhar s sweetsrihe...@... wrote: How to integrate a HTML page inside the flex, i tried a lot using iframeetc but everything redirects to another page , i need the HTML page inside the flex without redirecting... Plz guide me how to process... Waiting 4 ur Replies
[flexcoders] Re: flex 4 - NavigatorContent question / element parent
Thanks for the info. I won't need an example as your explanation has given me an insight. Very useful. --- In flexcoders@yahoogroups.com, Netaman rtigr...@... wrote: I use viewStack.removeAllChildren(); also, what I do with the NavigatorContent, is everytime I create a new NavigatorContent container I load the resulting child UI component object into an arrayCollection then when I need to get to the object inside the NavigatorContent I use the viewStack.selectedIndex as an index to the ArrayCollection to manipulate the object, or generate a popup, etc... public function setNavContent(navLabel:String, newView:*):void { var itemNav:NavigatorContent = new NavigatorContent(); itemNav.label = navLabel; itemNav.addEventListener(MouseEvent.DOUBLE_CLICK, circleD.editForms); itemNav.doubleClickEnabled = true; itemNav.minHeight = 300; itemNav.minWidth = 400; itemNav.addElement(newView); circleD.peViewStack.addChild(itemNav); } Where navLabel is a tab string and newView is a UI component usually a composite component If you need a whitewashed code example let me know. Randy --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: myPanel.owner is the same as myPanel.parent so that won't work. Making it a property would work. What would the disadvantages be with using myPanel.parent.parent.parent (a trace shows this to be the navigatorcontent)? I wonder why there is no such property like 'elementParent' to go with addElement() analagous to 'parent' and addChild()? one follow up question - I'm now adding the NavigatorContent to a viewstack. When i do viewstack.removeChild(nc), how do i make sure nc (naviagtorcontent) is destroyed? thanks --- In flexcoders@yahoogroups.com, valdhor valdhorlists@ wrote: Or make nc a property of the class so you can use it in any method. --- In flexcoders@yahoogroups.com, Alex Harui aharui@ wrote: Try myPanel.owner On 6/9/10 8:23 AM, bhaq1972 mbhaque@ wrote: I added a Panel component into a NavigatorContent public function aMethod():void { var nc:NavigatorContent = new NavigatorContent(); nc.addElement(myPanel); } Now, in another method I want to access this NavigatorContent eg public function anotherMethod(myPanel:Panel):void { var nc:NavigatorContent = myPanel.parent as NavigatorContent; however nc is not myPanel.parent. doing a trace, the navigatorContent is actually the myPanel.parent.parent.parent Is there not a property/method which gets me a reference to the element Parent (a bit like addChild() / parent relationship) -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] Re: flex 4 - NavigatorContent question / element parent
thanks --- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote: nc = null; --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: myPanel.owner is the same as myPanel.parent so that won't work. Making it a property would work. What would the disadvantages be with using myPanel.parent.parent.parent (a trace shows this to be the navigatorcontent)? I wonder why there is no such property like 'elementParent' to go with addElement() analagous to 'parent' and addChild()? one follow up question - I'm now adding the NavigatorContent to a viewstack. When i do viewstack.removeChild(nc), how do i make sure nc (naviagtorcontent) is destroyed? thanks --- In flexcoders@yahoogroups.com, valdhor valdhorlists@ wrote: Or make nc a property of the class so you can use it in any method. --- In flexcoders@yahoogroups.com, Alex Harui aharui@ wrote: Try myPanel.owner On 6/9/10 8:23 AM, bhaq1972 mbhaque@ wrote: I added a Panel component into a NavigatorContent public function aMethod():void { var nc:NavigatorContent = new NavigatorContent(); nc.addElement(myPanel); } Now, in another method I want to access this NavigatorContent eg public function anotherMethod(myPanel:Panel):void { var nc:NavigatorContent = myPanel.parent as NavigatorContent; however nc is not myPanel.parent. doing a trace, the navigatorContent is actually the myPanel.parent.parent.parent Is there not a property/method which gets me a reference to the element Parent (a bit like addChild() / parent relationship) -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] Re: flex 4 - NavigatorContent question / element parent
myPanel.owner is the same as myPanel.parent so that won't work. Making it a property would work. What would the disadvantages be with using myPanel.parent.parent.parent (a trace shows this to be the navigatorcontent)? I wonder why there is no such property like 'elementParent' to go with addElement() analagous to 'parent' and addChild()? one follow up question - I'm now adding the NavigatorContent to a viewstack. When i do viewstack.removeChild(nc), how do i make sure nc (naviagtorcontent) is destroyed? thanks --- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote: Or make nc a property of the class so you can use it in any method. --- In flexcoders@yahoogroups.com, Alex Harui aharui@ wrote: Try myPanel.owner On 6/9/10 8:23 AM, bhaq1972 mbhaque@ wrote: I added a Panel component into a NavigatorContent public function aMethod():void { var nc:NavigatorContent = new NavigatorContent(); nc.addElement(myPanel); } Now, in another method I want to access this NavigatorContent eg public function anotherMethod(myPanel:Panel):void { var nc:NavigatorContent = myPanel.parent as NavigatorContent; however nc is not myPanel.parent. doing a trace, the navigatorContent is actually the myPanel.parent.parent.parent Is there not a property/method which gets me a reference to the element Parent (a bit like addChild() / parent relationship) -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] flex 4 - NavigatorContent question / element parent
I added a Panel component into a NavigatorContent public function aMethod():void { var nc:NavigatorContent = new NavigatorContent(); nc.addElement(myPanel); } Now, in another method I want to access this NavigatorContent eg public function anotherMethod(myPanel:Panel):void { var nc:NavigatorContent = myPanel.parent as NavigatorContent; however nc is not myPanel.parent. doing a trace, the navigatorContent is actually the myPanel.parent.parent.parent Is there not a property/method which gets me a reference to the element Parent (a bit like addChild() / parent relationship)
[flexcoders] Re: spark Panel titleBar equivalent
Thanks Alex --- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: Use a Custom skin for the Panel On 6/3/10 8:13 AM, bhaq1972 mbha...@... wrote: In flex 3 I used do add buttons to MyPanel (extends mx.containers.Panel) titleBar. var button:Button = new Button(); this.titleBar.addChild(button); whats the equivalent to this in Spark? one way i'm thinking of is using a basic layout, and positioning the buttons where I want. Just wanted to get an idea what approach others would take. thanks -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] spark Panel titleBar equivalent
In flex 3 I used do add buttons to MyPanel (extends mx.containers.Panel) titleBar. var button:Button = new Button(); this.titleBar.addChild(button); whats the equivalent to this in Spark? one way i'm thinking of is using a basic layout, and positioning the buttons where I want. Just wanted to get an idea what approach others would take. thanks
[flexcoders] Re: Which layout/container being used in Tour de flex
Anyone? --- In flexcoders@yahoogroups.com, bhaq1972 mbha...@... wrote: Just wondering, Can someone tell me which layout/container is being used for Featured Projects section in Tour De Flex (Under Introduction to Flex What's Possible). thanks
[flexcoders] Re: Generic Function To Set ComboBox Item
Generic form var item:String = xmlLC.getItemAt(i).collectionID; ?? Try this var item:String = xmlLC.getItemAt(i)[collectionID]; --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_ano...@... wrote: Actually, the dpID is different for each xmllistcollection being passed. For example, for an xmllistcollection consisting of Orders, I might have to need the OrderID, which I am accessing, and it goes on for another xmllistcollection of States, where on that collection, I might have to access StatesID. To give further clarification, say I have two combo boxes, cmbTeams and cmbCoach. the dataprovider for cmbTeams is xmllcTeams and for cmbCoach is xmllcCoach. I want a generic function such that I would be able to set the selectedItem for each Combo Box instead of writing two. private function SetComboBoxSelectedItem(itemToSelect:String, xmlLC:XMLListCollection, cmb:ComboBox, collectionID:String) Since the collectionID for the xmllcTeams is TeamID, then that is the value which I pass as collectionID in the function. For the xmllcCoach, it would be the CoachID. so what comes now is that when I want to call the function, the collectionID is represented by the actual ID which to match in the data provider. For the xmllcTeams var item:String = xmlLC.getItemAt(i).TeamID For the xmllcCoach var item:String = xmlLC.getItemAt(i).CoachID Generic form var item:String = xmlLC.getItemAt(i).collectionID; ?? Thanks. From: gareth_arch gareth_a...@... To: flexcoders@yahoogroups.com Sent: Wed, 19 May, 2010 10:34:35 Subject: [flexcoders] Re: Generic Function To Set ComboBox Item Don't you access properties in an XMLListCollection differently than in an ArrayCollection? So rather than... var item:String = dataProv.getItemAt(i).dpID; it would be var item:String = dataProv.getItemAt(i)@dpid; Try doing a debug of your code and see what is being returned also. --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_anolin@ wrote: Hi FlexCoders, I would want to create a generic function to be able to set a ComboBox item. The function I have goes like this: private function selectComboItem(itemID:String, dataProv:XMLListCollection, cmb:ComboBox, dpID:String) :void { for (var i:int = 0; i dataProv.length; i++) { var item:String = dataProv.getItemAt(i).dpID; if(itemID == item) { cmb.selectedIndex = i; break; } } } dpID is the data item in the XML List collection which should match the passed itemID. But I can't seem to get properly the item. Any suggestions highly appreciated. Thanks.
[flexcoders] Re: Generic Function To Set ComboBox Item
sorry, i meant var item:String = xmlLC.getItemAt(i)[collectionID]; --- In flexcoders@yahoogroups.com, bhaq1972 mbha...@... wrote: Generic form var item:String = xmlLC.getItemAt(i).collectionID; ?? Try this var item:String = xmlLC.getItemAt(i)[collectionID]; --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_anolin@ wrote: Actually, the dpID is different for each xmllistcollection being passed. For example, for an xmllistcollection consisting of Orders, I might have to need the OrderID, which I am accessing, and it goes on for another xmllistcollection of States, where on that collection, I might have to access StatesID. To give further clarification, say I have two combo boxes, cmbTeams and cmbCoach. the dataprovider for cmbTeams is xmllcTeams and for cmbCoach is xmllcCoach. I want a generic function such that I would be able to set the selectedItem for each Combo Box instead of writing two. private function SetComboBoxSelectedItem(itemToSelect:String, xmlLC:XMLListCollection, cmb:ComboBox, collectionID:String) Since the collectionID for the xmllcTeams is TeamID, then that is the value which I pass as collectionID in the function. For the xmllcCoach, it would be the CoachID. so what comes now is that when I want to call the function, the collectionID is represented by the actual ID which to match in the data provider. For the xmllcTeams var item:String = xmlLC.getItemAt(i).TeamID For the xmllcCoach var item:String = xmlLC.getItemAt(i).CoachID Generic form var item:String = xmlLC.getItemAt(i).collectionID; ?? Thanks. From: gareth_arch gareth_arch@ To: flexcoders@yahoogroups.com Sent: Wed, 19 May, 2010 10:34:35 Subject: [flexcoders] Re: Generic Function To Set ComboBox Item Don't you access properties in an XMLListCollection differently than in an ArrayCollection? So rather than... var item:String = dataProv.getItemAt(i).dpID; it would be var item:String = dataProv.getItemAt(i)@dpid; Try doing a debug of your code and see what is being returned also. --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_anolin@ wrote: Hi FlexCoders, I would want to create a generic function to be able to set a ComboBox item. The function I have goes like this: private function selectComboItem(itemID:String, dataProv:XMLListCollection, cmb:ComboBox, dpID:String) :void { for (var i:int = 0; i dataProv.length; i++) { var item:String = dataProv.getItemAt(i).dpID; if(itemID == item) { cmb.selectedIndex = i; break; } } } dpID is the data item in the XML List collection which should match the passed itemID. But I can't seem to get properly the item. Any suggestions highly appreciated. Thanks.
[flexcoders] Which layout/container being used in Tour de flex
Just wondering, Can someone tell me which layout/container is being used for Featured Projects section in Tour De Flex (Under Introduction to Flex What's Possible). thanks
[flexcoders] Re: spark ButtonBar selectedIndex out of view
Thanks. I haven't played with the Scroller so I will try it out (but a quick initial test gives a compile error ...a Scroller cant have a ButtonBar assigned to the default viewport property) I will probably go with Haykel's suggestion for now. thanks guys --- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: Maybe put the ButtonBar in a Scroller or put a Scroller in the ButtonBar skin? On 5/11/10 1:14 AM, bhaq1972 mbha...@... wrote: I have a spark ButtonBar with a horizontalLayout. The width of the ButtonBar is small ...so the end buttons don't show. When I set the selectedIndex to one of the end buttons...its not coming into view. How can I ensure the selectedItem is in view? thanks s:HGroup s:ButtonBar id=buttonbar1 width=500 requireSelection=true s:layout s:HorizontalLayout / /s:layout s:dataProvider s:ArrayCollection source=['Button1', 'Button2', 'Button3', 'Button4', 'Button5', 'Button6', 'Button7', 'Button8'] / /s:dataProvider /s:ButtonBar s:TextInput id=t1 text=7/ s:Button label=selectIndex click=buttonbar1.selectedIndex = Number(t1.text)/ /s:HGroup -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] Re: spark ButtonBar selectedIndex out of view
Thanks. --- In flexcoders@yahoogroups.com, Haykel BEN JEMIA hayke...@... wrote: You can use the getScrollPositionDeltaToElement() function of the layout and add the x value of the returned point to the horizontalScrollPosition. Basically something like this (not tested): buttonbar1.layout.horizontalScrollPosition += buttonbar1.layout.getScrollPositionDeltaToElement(buttonbar1.selectedIndex).x; Haykel Ben Jemia Allmas Web RIA Development http://www.allmas-tn.com On Tue, May 11, 2010 at 9:14 AM, bhaq1972 mbha...@... wrote: I have a spark ButtonBar with a horizontalLayout. The width of the ButtonBar is small ...so the end buttons don't show. When I set the selectedIndex to one of the end buttons...its not coming into view. How can I ensure the selectedItem is in view? thanks s:HGroup s:ButtonBar id=buttonbar1 width=500 requireSelection=true s:layout s:HorizontalLayout / /s:layout s:dataProvider s:ArrayCollection source=['Button1', 'Button2', 'Button3', 'Button4', 'Button5', 'Button6', 'Button7', 'Button8'] / /s:dataProvider /s:ButtonBar s:TextInput id=t1 text=7/ s:Button label=selectIndex click=buttonbar1.selectedIndex = Number(t1.text)/ /s:HGroup
[flexcoders] spark ButtonBar selectedIndex out of view
I have a spark ButtonBar with a horizontalLayout. The width of the ButtonBar is small ...so the end buttons don't show. When I set the selectedIndex to one of the end buttons...its not coming into view. How can I ensure the selectedItem is in view? thanks s:HGroup s:ButtonBar id=buttonbar1 width=500 requireSelection=true s:layout s:HorizontalLayout / /s:layout s:dataProvider s:ArrayCollection source=['Button1', 'Button2', 'Button3', 'Button4', 'Button5', 'Button6', 'Button7', 'Button8'] / /s:dataProvider /s:ButtonBar s:TextInput id=t1 text=7/ s:Button label=selectIndex click=buttonbar1.selectedIndex = Number(t1.text)/ /s:HGroup
[flexcoders] Re: Flex 4 ButtonBarButton skin to look like a LinkBar skin
Anyone who's interested, this is what I was missing from my ButtonBarButton skin fx:Script ![CDATA[ override protected function updateDisplayList(w:Number, h:Number) : void { super.updateDisplayList(w, h); // Remove the first separator if(hostComponent.itemIndex == 0) { separator.visible = false; } } ]] /fx:Script s:Group s:Line id=separator x=8 y=0 xFrom=0 xTo=0 yFrom=0 yTo=12 s:stroke s:SolidColorStroke color=0x00 weight=1 joints=miter/ /s:stroke /s:Line s:Label id=labelDisplay x=20 y=0 ..other attributes / /s:Group --- In flexcoders@yahoogroups.com, bhaq1972 mbha...@... wrote: Hi I'm trying to create a ButtonBar skin which looks like a halo LinkBar skin. However, i'm having a few issues with trying to create the separator graphic. So far my ButtonBarButton skin has a Label. 1) Do I create the separator graphic in updateDisplayList()? If so can someone help with a small example how to do it (so far I have failed to make it display) or 2) Do I declare it in mxml like !-- separator graphic here ... not sure of code../ s:Label id=labelDisplay/ or 3) am i going about this the wrong way and theres a better way any suggestion would be very helpful thanks
[flexcoders] Flex 4 ButtonBarButton skin to look like a LinkBar skin
Hi I'm trying to create a ButtonBar skin which looks like a halo LinkBar skin. However, i'm having a few issues with trying to create the separator graphic. So far my ButtonBarButton skin has a Label. 1) Do I create the separator graphic in updateDisplayList()? If so can someone help with a small example how to do it (so far I have failed to make it display) or 2) Do I declare it in mxml like !-- separator graphic here ... not sure of code../ s:Label id=labelDisplay/ or 3) am i going about this the wrong way and theres a better way any suggestion would be very helpful thanks
[flexcoders] Re: Dynamic skin on spark.component.textinput
try newObject.setStyle(skinClass, getDefinitionByName(spark.skins.spark.TextInputSkin)); instead of newObject[skinClass] = spark.skins.spark.TextInputSkin; --- In flexcoders@yahoogroups.com, Netaman rtigr...@... wrote: I stripped away most of the code and just have all the pertinent parts. The UIComponent is used because I don't know what class I will be adding to the application, I have hard coded the string for clarity. What I am trying to do is dynamically create a textinput spark component, but running into a problem with the skin class, when I create the UIComponent the skin is null and I get an exception when I add it to the HGroup. So thought that if I added the skinclass before I added the element to the HGroup it would work. Does anyone have any example code to set the skinclass of a textinput dynamically? private function createTextInput():void { var objClass:Class = getDefinitionByName( spark.components.TextInput ) as Class; var newObject:UIComponent = UIComponent( new objClass() ); var xObject:HGroup = new spark.components.HGroup(); var newLabel:Label = new spark.components.Label(); newLabel[ text ] = First Name:; newObject[skinClass] = spark.skins.spark.TextInputSkin; newObject.percentWidth = 20; xObject.addElement(newLabel); xObject.addElement(newObject); this.addElement( xObject ); }
[flexcoders] Flex 4 - Is it possible to create a generic Button skin
I have a set of button skins which all look like the following skin s:SparkSkin xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark fx:Metadata [HostComponent(spark.components.Button)] /fx:Metadata s:states s:State name=up / s:State name=over / s:State name=down / s:State name=disabled / /s:states !-- UP ICON -- s:BitmapImage source=@Embed('assets/previous_default.png') includeIn=up / !-- OVER ICON -- s:BitmapImage source=@Embed('assets/previous_hover.png') includeIn=over / !-- DOWN ICON -- s:BitmapImage source=@Embed('assets/previous_down.png') includeIn=down / /s:SparkSkin --- The only difference between all the skins is the image source they use. Is it possible to make this generic so I can define the image source in the style sheet. Thanks Btw, In Flex 3, it was very easy to change the image skin in the style sheets using styleName. eg mx:Button styleName=LeftArrow/ mx:Button styleName=RightArrow/ mx:Style .LeftArrow { upSkin: Embed(source=assets/previous_default.png); overSkin: Embed(source=assets/previous_hover.png); downSkin: Embed(source=assets/previous_down.png); } .RightArrow { upSkin: Embed(source=assets/right_default.png); overSkin: Embed(source=assets/right_hover.png); downSkin: Embed(source=assets/right_down.png); } /mx:Style
[flexcoders] Re: Flex 4 - Is it possible to create a generic Button skin
Its a great idea but I haven't been able to make it work. I will try again after lunch (need a break) --- In flexcoders@yahoogroups.com, Haykel BEN JEMIA hayke...@... wrote: Try this (not etsted): s:SparkSkin xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark fx:Metadata [HostComponent(spark.components.Button)] /fx:Metadata s:states s:State name=up / s:State name=over / s:State name=down / s:State name=disabled / /s:states s:BitmapImage source.up=getStyle('upSkin') source.over=getStyle('overSkin') source.down=getStyle('downSkin') / /s:SparkSkin Haykel Ben Jemia Allmas Web RIA Development http://www.allmas-tn.com On Tue, Apr 27, 2010 at 12:47 PM, bhaq1972 mbha...@... wrote: I have a set of button skins which all look like the following skin s:SparkSkin xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark fx:Metadata [HostComponent(spark.components.Button)] /fx:Metadata s:states s:State name=up / s:State name=over / s:State name=down / s:State name=disabled / /s:states !-- UP ICON -- s:BitmapImage source=@Embed('assets/previous_default.png') includeIn=up / !-- OVER ICON -- s:BitmapImage source=@Embed('assets/previous_hover.png') includeIn=over / !-- DOWN ICON -- s:BitmapImage source=@Embed('assets/previous_down.png') includeIn=down / /s:SparkSkin --- The only difference between all the skins is the image source they use. Is it possible to make this generic so I can define the image source in the style sheet. Thanks Btw, In Flex 3, it was very easy to change the image skin in the style sheets using styleName. eg mx:Button styleName=LeftArrow/ mx:Button styleName=RightArrow/ mx:Style .LeftArrow { upSkin: Embed(source=assets/previous_default.png); overSkin: Embed(source=assets/previous_hover.png); downSkin: Embed(source=assets/previous_down.png); } .RightArrow { upSkin: Embed(source=assets/right_default.png); overSkin: Embed(source=assets/right_hover.png); downSkin: Embed(source=assets/right_down.png); } /mx:Style
[flexcoders] Re: Flex 4 - Is it possible to create a generic Button skin
Hasn't worked. --- In flexcoders@yahoogroups.com, Haykel BEN JEMIA hayke...@... wrote: If it does not work try replacing getStyle with hostComponent.getStyle. Haykel Ben Jemia Allmas Web RIA Development http://www.allmas-tn.com On Tue, Apr 27, 2010 at 1:43 PM, bhaq1972 mbha...@... wrote: Its a great idea but I haven't been able to make it work. I will try again after lunch (need a break) --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Haykel BEN JEMIA haykelbj@ wrote: Try this (not etsted): s:SparkSkin xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark fx:Metadata [HostComponent(spark.components.Button)] /fx:Metadata s:states s:State name=up / s:State name=over / s:State name=down / s:State name=disabled / /s:states s:BitmapImage source.up=getStyle('upSkin') source.over=getStyle('overSkin') source.down=getStyle('downSkin') / /s:SparkSkin Haykel Ben Jemia Allmas Web RIA Development http://www.allmas-tn.com On Tue, Apr 27, 2010 at 12:47 PM, bhaq1972 mbhaque@ wrote: I have a set of button skins which all look like the following skin s:SparkSkin xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark fx:Metadata [HostComponent(spark.components.Button)] /fx:Metadata s:states s:State name=up / s:State name=over / s:State name=down / s:State name=disabled / /s:states !-- UP ICON -- s:BitmapImage source=@Embed('assets/previous_default.png') includeIn=up / !-- OVER ICON -- s:BitmapImage source=@Embed('assets/previous_hover.png') includeIn=over / !-- DOWN ICON -- s:BitmapImage source=@Embed('assets/previous_down.png') includeIn=down / /s:SparkSkin --- The only difference between all the skins is the image source they use. Is it possible to make this generic so I can define the image source in the style sheet. Thanks Btw, In Flex 3, it was very easy to change the image skin in the style sheets using styleName. eg mx:Button styleName=LeftArrow/ mx:Button styleName=RightArrow/ mx:Style .LeftArrow { upSkin: Embed(source=assets/previous_default.png); overSkin: Embed(source=assets/previous_hover.png); downSkin: Embed(source=assets/previous_down.png); } .RightArrow { upSkin: Embed(source=assets/right_default.png); overSkin: Embed(source=assets/right_hover.png); downSkin: Embed(source=assets/right_down.png); } /mx:Style
[flexcoders] Re: Creating Spark controlBar with ActionScript
I did this little test. It should help. s:Panel id=panel1 title=panel width=50% height=50% s:controlBarContent s:Label text=Label appears in Control Bar/ /s:controlBarContent /s:Panel s:Button click=test() label=add/ fx:Script ![CDATA[ public function test():void { var lab:Label = new Label(); lab.text = This Label I added after a button click; panel1.controlBarGroup.addElement(lab); } ]] /fx:Script --- In flexcoders@yahoogroups.com, de.newsight gro...@... wrote: Hi all, I'm looking for an example how to create a Spark controlbar with AS not MXML. Any ideas are more than appreciated. Artur
[flexcoders] Re: Flex 4 - Is it possible to create a generic Button skin
Thanks. That worked! Something else I tried also worked. Its based on original skin and uses updateDisplayList()...code below But your suggestion is more elegant and better! Thanks for your help code s:BitmapImage id=myUpImage includeIn=up / s:BitmapImage id=myOverImage includeIn=over / s:BitmapImage id=myDownImage includeIn=down / override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number) : void { if(myUpImage) { myUpImage.source = getStyle(upSkin); } if(myOverImage) { myOverImage.source = getStyle(overSkin); } if(myDownImage) { myDownImage.source = getStyle(downSkin); } super.updateDisplayList(unscaledWidth, unscaledHeight); } } --- In flexcoders@yahoogroups.com, Haykel BEN JEMIA hayke...@... wrote: Of course! The getStyle function calls need to be set in curly braces like: source.up={getStyle('upSkin')} Sorry! Haykel Ben Jemia Allmas Web RIA Development http://www.allmas-tn.com On Tue, Apr 27, 2010 at 3:03 PM, bhaq1972 mbha...@... wrote: Hasn't worked. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Haykel BEN JEMIA haykelbj@ wrote: If it does not work try replacing getStyle with hostComponent.getStyle. Haykel Ben Jemia Allmas Web RIA Development http://www.allmas-tn.com On Tue, Apr 27, 2010 at 1:43 PM, bhaq1972 mbhaque@ wrote: Its a great idea but I haven't been able to make it work. I will try again after lunch (need a break) --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.comflexcoders% 40yahoogroups.com, Haykel BEN JEMIA haykelbj@ wrote: Try this (not etsted): s:SparkSkin xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark fx:Metadata [HostComponent(spark.components.Button)] /fx:Metadata s:states s:State name=up / s:State name=over / s:State name=down / s:State name=disabled / /s:states s:BitmapImage source.up=getStyle('upSkin') source.over=getStyle('overSkin') source.down=getStyle('downSkin') / /s:SparkSkin Haykel Ben Jemia Allmas Web RIA Development http://www.allmas-tn.com On Tue, Apr 27, 2010 at 12:47 PM, bhaq1972 mbhaque@ wrote: I have a set of button skins which all look like the following skin s:SparkSkin xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark fx:Metadata [HostComponent(spark.components.Button)] /fx:Metadata s:states s:State name=up / s:State name=over / s:State name=down / s:State name=disabled / /s:states !-- UP ICON -- s:BitmapImage source=@Embed('assets/previous_default.png') includeIn=up / !-- OVER ICON -- s:BitmapImage source=@Embed('assets/previous_hover.png') includeIn=over / !-- DOWN ICON -- s:BitmapImage source=@Embed('assets/previous_down.png') includeIn=down / /s:SparkSkin --- The only difference between all the skins is the image source they use. Is it possible to make this generic so I can define the image source in the style sheet. Thanks Btw, In Flex 3, it was very easy to change the image skin in the style sheets using styleName. eg mx:Button styleName=LeftArrow/ mx:Button styleName=RightArrow/ mx:Style .LeftArrow { upSkin: Embed(source=assets/previous_default.png); overSkin: Embed(source=assets/previous_hover.png); downSkin: Embed(source=assets/previous_down.png); } .RightArrow { upSkin: Embed(source=assets/right_default.png); overSkin: Embed(source=assets/right_hover.png); downSkin: Embed(source=assets/right_down.png); } /mx:Style
[flexcoders] Spark Panel width=0 but still showing
I am setting the width of a Spark Panel to zero but I can still see it. Halo Panel does not have this problem. Any ideas? Thanks in Advance. Here's a simple example ?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 s:layout s:VerticalLayout horizontalAlign=center paddingTop=20 paddingLeft=5 paddingRight=5/ /s:layout fx:Script ![CDATA[ public function changeWidth():void { // change menu Panel width var width1:int = 0.25 * MainPanel.width; panelMenu.width = (panelMenu.width == 0) ? width1 : 0; } ]] /fx:Script s:Button label=click click=changeWidth()/ s:Panel id=MainPanel title=panel width=100% height=100% mx:HDividedBox width=100% height=100% horizontalScrollPolicy=off mx:ViewStack id=vsContainer width=75% height=100%/ s:Panel id=panelMenu title=Topics width=25% height=100% s:Label text=halo Panel ok. spark has an issue/ /s:Panel /mx:HDividedBox /s:Panel /s:Application - Same test using Halo Panel ?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 s:layout s:VerticalLayout horizontalAlign=center paddingTop=20 paddingLeft=5 paddingRight=5/ /s:layout fx:Script ![CDATA[ public function changeWidth():void { // change menu Panel width var width1:int = 0.25 * MainPanel.width; panelMenu.width = (panelMenu.width == 0) ? width1 : 0; } ]] /fx:Script s:Button label=click click=changeWidth()/ s:Panel id=MainPanel title=panel width=100% height=100% mx:HDividedBox width=100% height=100% horizontalScrollPolicy=off mx:ViewStack id=vsContainer width=75% height=100%/ mx:Panel id=panelMenu title=Topics width=25% height=100% s:Label text=halo Panel ok. spark has an issue/ /mx:Panel /mx:HDividedBox /s:Panel /s:Application
[flexcoders] Re: Spark Panel width=0 but still showing
Sorted... I need the property clipAndEnableScrolling=true for the main panel to be set. s:Panel id=MainPanel s:layout s:VerticalLayout clipAndEnableScrolling=true /s:layout /s:Panel --- In flexcoders@yahoogroups.com, bhaq1972 mbha...@... wrote: I am setting the width of a Spark Panel to zero but I can still see it. Halo Panel does not have this problem. Any ideas? Thanks in Advance. Here's a simple example ?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 s:layout s:VerticalLayout horizontalAlign=center paddingTop=20 paddingLeft=5 paddingRight=5/ /s:layout fx:Script ![CDATA[ public function changeWidth():void { // change menu Panel width var width1:int = 0.25 * MainPanel.width; panelMenu.width = (panelMenu.width == 0) ? width1 : 0; } ]] /fx:Script s:Button label=click click=changeWidth()/ s:Panel id=MainPanel title=panel width=100% height=100% mx:HDividedBox width=100% height=100% horizontalScrollPolicy=off mx:ViewStack id=vsContainer width=75% height=100%/ s:Panel id=panelMenu title=Topics width=25% height=100% s:Label text=halo Panel ok. spark has an issue/ /s:Panel /mx:HDividedBox /s:Panel /s:Application - Same test using Halo Panel ?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 s:layout s:VerticalLayout horizontalAlign=center paddingTop=20 paddingLeft=5 paddingRight=5/ /s:layout fx:Script ![CDATA[ public function changeWidth():void { // change menu Panel width var width1:int = 0.25 * MainPanel.width; panelMenu.width = (panelMenu.width == 0) ? width1 : 0; } ]] /fx:Script s:Button label=click click=changeWidth()/ s:Panel id=MainPanel title=panel width=100% height=100% mx:HDividedBox width=100% height=100% horizontalScrollPolicy=off mx:ViewStack id=vsContainer width=75% height=100%/ mx:Panel id=panelMenu title=Topics width=25% height=100% s:Label text=halo Panel ok. spark has an issue/ /mx:Panel /mx:HDividedBox /s:Panel /s:Application
[flexcoders] Re: Flex 4 HGroup and Group background colour
Thanks Peter. --- In flexcoders@yahoogroups.com, Peter DeHaan pdeh...@... wrote: Try setting the Rect's width/height to 100%: ?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 s:layout s:VerticalLayout / /s:layout s:Group width=100% height=28 s:Rect top=0 right=0 bottom=0 left=0 s:fill s:SolidColor color=green / /s:fill /s:Rect /s:Group s:HGroup width=100% height=28 s:Rect width=100% height=100% s:fill s:SolidColor color=red / /s:fill /s:Rect /s:HGroup /s:Application Not exactly sure why using left/right/top/bottom constraints didn't work on the bottom HGroup, but feel free to file a bug at http://bugs.adobe.com/flex/ and Adobe can look into it. Peter From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of bhaq1972 Sent: Thursday, April 22, 2010 4:53 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Flex 4 HGroup and Group background colour Why does this work s:Group width=100% height=28 s:Rect top=0 right=0 bottom=0 left=0 s:fill s:SolidColor color=0x4960a6 / /s:fill /s:Rect /s:Group But this doesnt? s:HGroup width=100% height=28 s:Rect s:fill s:SolidColor color=0x4960a6 / /s:fill /s:Rect /s:HGroup thanks
[flexcoders] Re: Flex 4 HGroup and Group background colour
I was actually using an absolute layout container, when I first noticed the problem. I'm not planning to file a bug. I'm still new to flex4 skinning. So was probably using it incorrectly. Any way, since posting my orginal question I found s:BorderContainer to be a better candidate in what I want to achieve. Flex4 skinning is very powerful and I have already been able to achieve something I couldnt do in Flex3. thanks bodrul --- In flexcoders@yahoogroups.com, Haykel BEN JEMIA hayke...@... wrote: I don't think this is bug because using top,left, right and bottom properties would need a layout that uses absolute positioning, while vertical, horizontal and tail layout are automatic layouts and don't use absolute positioning. Haykel Ben Jemia Allmas Web RIA Development http://www.allmas-tn.com On Fri, Apr 23, 2010 at 9:45 AM, bhaq1972 mbha...@... wrote: Thanks Peter. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Peter DeHaan pdehaan@ wrote: Try setting the Rect's width/height to 100%: ?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 s:layout s:VerticalLayout / /s:layout s:Group width=100% height=28 s:Rect top=0 right=0 bottom=0 left=0 s:fill s:SolidColor color=green / /s:fill /s:Rect /s:Group s:HGroup width=100% height=28 s:Rect width=100% height=100% s:fill s:SolidColor color=red / /s:fill /s:Rect /s:HGroup /s:Application Not exactly sure why using left/right/top/bottom constraints didn't work on the bottom HGroup, but feel free to file a bug at http://bugs.adobe.com/flex/ and Adobe can look into it. Peter From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com [mailto: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] On Behalf Of bhaq1972 Sent: Thursday, April 22, 2010 4:53 AM To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Subject: [flexcoders] Flex 4 HGroup and Group background colour Why does this work s:Group width=100% height=28 s:Rect top=0 right=0 bottom=0 left=0 s:fill s:SolidColor color=0x4960a6 / /s:fill /s:Rect /s:Group But this doesnt? s:HGroup width=100% height=28 s:Rect s:fill s:SolidColor color=0x4960a6 / /s:fill /s:Rect /s:HGroup thanks
[flexcoders] Flex 4 HGroup and Group background colour
Why does this work s:Group width=100% height=28 s:Rect top=0 right=0 bottom=0 left=0 s:fill s:SolidColor color=0x4960a6 / /s:fill /s:Rect /s:Group But this doesnt? s:HGroup width=100% height=28 s:Rect s:fill s:SolidColor color=0x4960a6 / /s:fill /s:Rect /s:HGroup thanks
[flexcoders] Re: Help! - Intermittent Network Issues - How do you handle?
I don't have a suggestion but wanted to know if you found anything useful to help your problem? We had one customer who had this problem on one of their pc's. But I never got to the bottom of what was happening. It became a low grade issue (as it was only one pc). I couldn't replicate the problem and the customer did a few upgrades/re-installations etc. and the problem went away. Have you looked at the firewall logs before and after the new firewall? that maybe a start. Also, if the network has intermittent issues, you could try and re-send your request ...but this will only work if the intermittent issue goes away. good luck --- In flexcoders@yahoogroups.com, rojoe615 headj...@... wrote: We are in the process of rolling out an app using LCDS and Flex. I posted an earlier note about intermittent network issues, but things have gotten much worse. About the only thing users can do is shut down their browser and restart after getting messages about faultCode = Channel.Call.Failed and faultDetail = NetConnection.Call.Failed: HTTP: Failed. This all appeared to start when our infrastructure guys started using Blue Coat Systems as firewall provider. Maybe I am missing something, but shouldn't LCDS and Flex be smart enough to know if the connection has been dropped? Surely I am not the only person that has run across this...(or maybe I am) I mean if the product is being marketed for eCommerce type work, you would expect there would be issues like intermittent connections and DNS problems in the Internet. So shouldn't it handle issues like this? So I'm appealing to some of you Flex experts out there for some insight. Anyone else run across stuff like this and what did you do for it? Thanks, Joe
[flexcoders] Re: What's wrong with this basic AS3 code?
Doesn't make sense. I just tried it out and it works for me in an ActionScript project as well. Clearly, you Car class constructor takes 2 arguments, and its being passed 2 args in the instantiation. If you are using flexbuilder try click ProjectClean (this will build the project like its building for the very first time) If that doesnt work. Try creating a new Flex Project and just add your Car class and my test.mxml class. --- In flexcoders@yahoogroups.com, ellistein52 ellistei...@... wrote: It won't allow me to create anMXML application in a pure Actionscript joject. So I careted a simple as.script . The problem seems the program itself. After I finished it and try to compiled it it was showing those same errors way before I create the AS script to call the method: public function test():void { var yugo:Car = new Car(10, North); yugo.showVelocity( ); } This AS.script returns the same error and the program seems perfect. --- In flexcoders@yahoogroups.com, ellistein52 ellistein52@ wrote: ArgumentError: Error #1063: Argument count mismatch on Car(). Expected 2, got 0. Here's the code: package { public class Car { private var speed:Number; private var direction:String; public function Car(speed:Number,direction:String) { this.speed = speed; this.direction = direction; } public function showVelocity():void { trace(The car's velocity is +this.speed + KPH +this.direction); } public function crash():void { trace(Boom!); } } } Then I built a class inside of the package Car class and called the method: var yugo:Car = new Car(10, North); yugo.showVelocity();
[flexcoders] Re: Pasting an image into an image or bitmap container?
yeh sure. here you go. http://www.cynergysystems.com/blogs/page/andrewtrice?entry=flex_2_bitmapdata_tricks_and its a Flex2 example but still works with flex 3 /4 --- In flexcoders@yahoogroups.com, Nick Middleweek n...@... wrote: Do you have a link to this blog though please? I'm still interested in reading through it... I've just googled Andrew Trice BitMapData blog getUIComponentBitmapData but can't find what you've mentioned. Cheers, Nick On 25 March 2010 10:43, bhaq1972 mbha...@... wrote: I think i'm barking up the wrong tree. I misread your question. thanks Bod
[flexcoders] Re: Pasting an image into an image or bitmap container?
But, pressing Print Screen and then pasting it into an image container would be much nicer and more consistant. Have you checked out Andrew Trice's BitMapData blog. Very clever stuff. Just an idea. When someone presses the PrintScreen button, call his function getUIComponentBitmapData() to copy your screen into an image container. --- In flexcoders@yahoogroups.com, Nick Middleweek n...@... wrote: Hi, I really wanted the user to be able to just paste into Flex and then click send. It's for a tech support system and when ever there are screen errors, they get logged. At the moment they're either pasted in word and word is uploaded or those that know how, paste into MS Paint, save as a JPEG and upload that. But, pressing Print Screen and then pasting it into an image container would be much nicer and more consistant. Thanks, Nick On 24 March 2010 16:19, valdhor valdhorli...@... wrote: I don't think so. Why not just ask them to open the file on their system and then you could upload it to the server. I don't do this with images but I do with MS Excel files. There are many Flex File Upload examples.
[flexcoders] Re: Pasting an image into an image or bitmap container?
I think i'm barking up the wrong tree. I misread your question. thanks Bod --- In flexcoders@yahoogroups.com, Nick Middleweek n...@... wrote: Hi, I think that is only for grabbing the bitmap of a Flex or Air app container. I want the ability for the user to paste any image into the image container. I check out the blog just incase there is some other magic there... Cheers, Nick On 25 March 2010 09:31, bhaq1972 mbha...@... wrote: But, pressing Print Screen and then pasting it into an image container would be much nicer and more consistant. Have you checked out Andrew Trice's BitMapData blog. Very clever stuff. Just an idea. When someone presses the PrintScreen button, call his function getUIComponentBitmapData() to copy your screen into an image container.
[flexcoders] Re: What's wrong with this basic AS3 code?
your class Car looks okay and so does you syntax to instantiate it and method call. try this. Create an Application(test.mxml) in the same folder location as your Car.as file. mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Button label=test click=test()/ mx:Script ![CDATA[ public function test():void { var yugo:Car = new Car(10, North); yugo.showVelocity(); } ]] /mx:Script /mx:Appllication --- In flexcoders@yahoogroups.com, ellistein52 ellistei...@... wrote: ArgumentError: Error #1063: Argument count mismatch on Car(). Expected 2, got 0. Here's the code: package { public class Car { private var speed:Number; private var direction:String; public function Car(speed:Number,direction:String) { this.speed = speed; this.direction = direction; } public function showVelocity():void { trace(The car's velocity is +this.speed + KPH +this.direction); } public function crash():void { trace(Boom!); } } } Then I built a class inside of the package Car class and called the method: var yugo:Car = new Car(10, North); yugo.showVelocity();
[flexcoders] Re: From your own experience how long does it take to learn AS3?
Referring back to your lessons is no different to what you would do if you were learning any new skill (eg learning English or French). You will keep doing that until you become familiarand then you move to more complex stuff. My suggestion would be keep looking at examples, try them out. Then see how you can apply them. When you get stuck, post a question...see if its in scope of AS3 capabilities. Like you, I came into programming with absolutely no background in IT. So its definately possible. A logical brain helps. 4 weeks is nothing. --- In flexcoders@yahoogroups.com, ellistein52 ellistei...@... wrote: I have no background in programming , I am close to 54.I am following some AS3 Lynda.com Essential Training. I seem to understand the material but when I try to make a simple program on my own I am lost , I have to refer back to the lesson to be able to write a simple line of code on my own.Also I started learning the material 4 weeks ago so maybe it is too early for me to write my own code? I would appreciate your comments regarding this issue.
[SPAM] Re: [flexcoders] DataGrid is blank
sometimes setting the dataprovider to null (or new Object) worked for me. partsGrid.dataProvider = null; partsGrid.dataProvider = partsListCollection; or set the dataProvider in another event like creationComplete. --- In flexcoders@yahoogroups.com, Tracy Spratt tr...@... wrote: I think I would create a composite component with a header and either a List or a VBox and a repeater. Instead of using DataGrid Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Alex Harui Sent: Thursday, January 21, 2010 12:10 AM To: flexcoders@yahoogroups.com Subject: [SPAM] Re: [flexcoders] DataGrid is blank It is unusual to be creating new DataGrids in a loop On 1/20/10 8:08 PM, normc_actionscript normcousin...@... wrote: My DataGrid contains data, but is now showing it. (See itemClickEvent function.) Anybody know why? (PS feel free to critisize any other aspect of my code, i'm just learning) public function itemClickEvent(e:ListEvent):void{ Alert.show(String(e.target.selectedItem)); // THIS SHOWS WHAT'S EXPECTED } public function addToGrid(e:Event):void{ // This adds several 1 column dataGrids to an hbox, because I need lists with column headers. // One dataGrid won't work, because the lists are different lengths. categories = new XMLList(urlLoader.data) for each (var cat:XML in categories.*){ var partsGrid:DataGrid = new DataGrid(); var partsListCollection:XMLListCollection = new XMLListCollection(cat.children()) var df:XML=XML(partsListCollection.getItemAt(0)) partsGrid.dataProvider = partsListCollection; var dgc:DataGridColumn = new DataGridColumn(); dgc.headertext=c...@...(); dgc.dataField=df.name(); var cols:Array =new Array() cols.push(dgc) partsGrid.columns = cols; gridHbox.addChild(partsGrid) partsGrid.addEventListener(ListEvent.ITEM_CLICK, itemClickEvent) partsGrid.validateNow()// just to show you that I tried this but it doesn't work. } } -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs. http://blogs.adobe.com/aharui adobe.com/aharui
[flexcoders] Re: ListEvent ItemRollOver columnIndex value is wrong
Thanks for the feedback. I didn't know this was already raised. thanks for that. I will check out JIRA. Its not a show stopper, you can easily get the real e.columnIndex by just adding the number of invisible columns that appear in the columns array before e.columnIndex. ie var invisibleColCount:int=0; for(var i:int=0;ie.columnIndex+1;i++) { if(!this.columns[i].visible) { invisibleColCount++; } } var realColumnIndex:int = e.columnIndex + invisbleColCount; --- In flexcoders@yahoogroups.com, Andriy Panas a.pa...@... wrote: Hi all, DataGridColumn is not descendant of UIComponent, thus it does not have includeInLayout property. This issue with incorrect columnIndex in ListEvent object inside itemRollOver event handler was first reported in 2008, but now it has a status Deferred. If this issue is important to you, go to JIRA and vote. https://bugs.adobe.com/jira/browse/SDK-17823 -- Best regards, Andriy Panas 2010/1/11 invertedspear invertedsp...@... I think, but I'm not sure, that when you set your col0 to be invisible, you need to also set includedInLayout = true; ~mike --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, bhaq1972 mbhaque@ wrote: I have an itemRollover event handler in my datagrid. This datagrid also has some invisble columns (i made them visible=false during the datagrid's initialize event) Now if I make col0 invisible, and col1 visible, i.e. mx:DataGridColumn dataField=col0 visible=false.. mx:DataGridColumn dataField=col1 visible=true.. when I try to determine which column i'm rollong over...i'm getting the wrong value public function itemRolloverHandler(e:ListEvent):void { var myDataField:String = this.columns[e.columnIndex].dataField; //myDataField=col0 but it should be col1 as col0 is invsible } Is there anything I can do so e.columnIndex has the right value? thanks
[flexcoders] ListEvent ItemRollOver columnIndex value is wrong
I have an itemRollover event handler in my datagrid. This datagrid also has some invisble columns (i made them visible=false during the datagrid's initialize event) Now if I make col0 invisible, and col1 visible, i.e. mx:DataGridColumn dataField=col0 visible=false.. mx:DataGridColumn dataField=col1 visible=true.. when I try to determine which column i'm rollong over...i'm getting the wrong value public function itemRolloverHandler(e:ListEvent):void { var myDataField:String = this.columns[e.columnIndex].dataField; //myDataField=col0 but it should be col1 as col0 is invsible } Is there anything I can do so e.columnIndex has the right value? thanks
[flexcoders] Re: Problem Casting an Object to a known type
Hi Nick If the returned object has 3 nested levels its xml but if it 4 nested levels its not? Do you use flexbuilder debugger? It might be worth putting a breakpoint at the point where you return from the httpserviceand examining it. It might not be a object which can be typecasted to ContactPerson(). Are you sure its a Compiler error or was it a Runtime error? Bodrul --- In flexcoders@yahoogroups.com, Nick Middleweek n...@... wrote: Hello... We've just run into a problem... Has anyone else come across this before? We're making HTTP Service calls and we're getting back nested data. We have set the resultFormat=e4x which we then parse into known Object types, such a IContactData, IInvoiceDetails... The Problem: With some service calls, the data returned has 4 or more levels of nested data. In these cases, Flex isn't giving us XML. It is just returning an untyped Object with the nested data. If the returned data has 3 levels or less of nested data then we get XML. We then thought, ok... The untyped Object returned by Flex does have all the properties required to Cast it to our typed Object, e.g. IContactData... But we are getting a Coercion failed message by the Compiler. Here's a basic example of the problem... var myPerson : Object = new Object(); myPerson.age = 25; myPerson.sex = dunno myPerson.name = Nick; var myContact : ContactPerson = new ContactPerson(); myContact = ContactPerson(myPerson); // Where ContactPerson is a typed Object with age, sex and name String properties. So has anyone managed to solve the 4 levels of nested data problem from an HTTP Service call? and :) Why can't we cast an untyped Object into a typed Object? :) Cheers guys... Nick
[flexcoders] Re: RTE - DataGridHeader/mouseOutHandler
Hi Alex. Thanks for the advice. I think I know what chain of events is leading to this bug.its the appearance of the sort arrow. When I place my mouse cursor on the bottom right corner of the column header (the position where the sort arrow appears) and click the header to retrieve my new sql. The new data is retrieved but at the same time, the appearance of the sort arrow actually triggers a DataGridHeader.MouseOut event (which leads to the RTE). What iv'e done now is I disable the column (column.sortable=false) when I make the asynchronous call for new data. And then enable it (column.sortable=true) once I populate the datagrid with new data. I don't see the sort arrow but that doesn't matter as this really isn't a sort. thanks anyway. bod --- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: Probably some timing bug. Maybe use callLater to delay the changing of the data or send a fake mouseOut event. Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of bhaq1972 Sent: Monday, November 30, 2009 2:43 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: RTE - DataGridHeader/mouseOutHandler Yes. The initial dataProvider was showing all orders from the ORDER table (eg select * from ORDERS). When a user clicks the column header I want to only show orders a specific type of order (eg select * from ORDERS where OrderType = 'short') btw the column has an Image itemRenderer eg myDataGridColumn dataField=OrderType itemRenderer=mx.controls.Image ../ --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Alex Harui aharui@ wrote: Is the column set changing based on the new data? Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of bhaq1972 Sent: Monday, November 30, 2009 8:26 AM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] RTE - DataGridHeader/mouseOutHandler I'm getting this runtime error which I hope someone can help me with. Basically, I added a headerRelease event to my DataGrid. The plan is...when a user clicks a dg column header rather than sorting the rows, i plan to re-populate the datagrid with rows from a different sql database call. eg mx:DataGrid headerRelease=headerClicked(event) .. .. public function headerClicked(e:DataGridEvent):void { var col:myDGColumn = this.columns[e.columnIndex]; if(col.filter) { // make a different database call to populate dg dataprovider } } Now this seems to be working except sometimes (quite often actually) I get the following runtime error. TypeError: Error #1010: A term is undefined and has no properties. at mx.controls.dataGridClasses::DataGridHeader/mouseOutHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\dataGridClasses\DataGridHeader.as:1078] Using the debugger, the code is dying on the following if statement (of mouseOutHandler()) if (visibleColumns[i].sortable) { ... in my case visibleColumns.length = 10 and i=10 .hence the RTE. Can some one suggest a workaround please regards bod
[flexcoders] RTE - DataGridHeader/mouseOutHandler
I'm getting this runtime error which I hope someone can help me with. Basically, I added a headerRelease event to my DataGrid. The plan is...when a user clicks a dg column header rather than sorting the rows, i plan to re-populate the datagrid with rows from a different sql database call. eg mx:DataGrid headerRelease=headerClicked(event) .. .. public function headerClicked(e:DataGridEvent):void { var col:myDGColumn = this.columns[e.columnIndex]; if(col.filter) { // make a different database call to populate dg dataprovider } } Now this seems to be working except sometimes (quite often actually) I get the following runtime error. TypeError: Error #1010: A term is undefined and has no properties. at mx.controls.dataGridClasses::DataGridHeader/mouseOutHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\dataGridClasses\DataGridHeader.as:1078] Using the debugger, the code is dying on the following if statement (of mouseOutHandler()) if (visibleColumns[i].sortable) { ... in my case visibleColumns.length = 10 and i=10 .hence the RTE. Can some one suggest a workaround please regards bod
[flexcoders] Re: RTE - DataGridHeader/mouseOutHandler
Yes. The initial dataProvider was showing all orders from the ORDER table (eg select * from ORDERS). When a user clicks the column header I want to only show orders a specific type of order (eg select * from ORDERS where OrderType = 'short') btw the column has an Image itemRenderer eg myDataGridColumn dataField=OrderType itemRenderer=mx.controls.Image ../ --- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: Is the column set changing based on the new data? Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of bhaq1972 Sent: Monday, November 30, 2009 8:26 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] RTE - DataGridHeader/mouseOutHandler I'm getting this runtime error which I hope someone can help me with. Basically, I added a headerRelease event to my DataGrid. The plan is...when a user clicks a dg column header rather than sorting the rows, i plan to re-populate the datagrid with rows from a different sql database call. eg mx:DataGrid headerRelease=headerClicked(event) .. .. public function headerClicked(e:DataGridEvent):void { var col:myDGColumn = this.columns[e.columnIndex]; if(col.filter) { // make a different database call to populate dg dataprovider } } Now this seems to be working except sometimes (quite often actually) I get the following runtime error. TypeError: Error #1010: A term is undefined and has no properties. at mx.controls.dataGridClasses::DataGridHeader/mouseOutHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\dataGridClasses\DataGridHeader.as:1078] Using the debugger, the code is dying on the following if statement (of mouseOutHandler()) if (visibleColumns[i].sortable) { ... in my case visibleColumns.length = 10 and i=10 .hence the RTE. Can some one suggest a workaround please regards bod
[flexcoders] Re: DatagridColumn dataField question
thanks for the clarification ...very useful advice. --- In flexcoders@yahoogroups.com, Tracy Spratt tr...@... wrote: Yes, as Beau says. One general clarification, the dataField property will only accept a string, never an expression (array1[0] is an expression). Similarly, you cannot dot.down in a dataField, like myVO.myProperty that is also an expression. To use the dataField, yu must be able to provide a reference to a first level property, including in an xml node, either an arttribute (@myAttribute) or first level child node. And one caution, Array (and XMLList) does not support binding. It will work once, on initialize, but if you programmatically change the Array, the bound control will not update. Use XML or one of the collections if you need to update the dataProvider at run-time. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Beau Scott Sent: Friday, August 28, 2009 10:44 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] DatagridColumn dataField question dataField is a property belonging to the objects within the datagrid's dataprovider. you don't access the array directly from your datagrid column, rather you just name the field to access. So in the case you gave of an array of strings, you'd only be able to display properties of the string objects themselves (such as length): mx:DataGridColumn dataField=length/ !-- would display the length of the string in each index -- You could use label function to just return the value of the object as well: mx:DataGridColumn labelFunction={function(... rest):String{return rest[0] as String;}} / !-- Will display the actual value of the string at the index's row. However if you make it an array of arrays of strings, you can most certain bind columns to indexes of the arrays of strings for display: ?xml version=1.0 encoding=utf-8? mx:WindowedApplication xmlns:mx=http://www.adobe. http://www.adobe.com/2006/mxml com/2006/mxml layout=absolute mx:Script ![CDATA[ [Bindable] public var dp:Array = [ ['1','2','3'], ['a', 'b', 'c'] ]; ]] /mx:Script mx:DataGrid width=100% dataProvider={dp} mx:columns mx:DataGridColumn dataField=0 / !-- Binds to dp[row][0] --- mx:DataGridColumn dataField=1 / !-- Binds to dp[row][1] --- mx:DataGridColumn dataField=2 / !-- Binds to dp[row][2] --- /mx:columns /mx:DataGrid /mx:WindowedApplication Beau On Fri, Aug 28, 2009 at 5:28 AM, bhaq1972 mbha...@hotmail. mailto:mbha...@... com wrote: Can the dataField reference an array position eg var array1:Array = [hello, world, etc]; ... mx:DataGridColumn dataField=array1[1] / at the moment the only way i can make this work is use a labelFunction eg mx:DataGridColumn dataField=array1[1] labelFunction=something/ Just wondered if there was any other way? TIA Bod -- Beau D. Scott Software Engineer
[flexcoders] DatagridColumn dataField question
Can the dataField reference an array position eg var array1:Array = [hello, world, etc]; ... mx:DataGridColumn dataField=array1[1] / at the moment the only way i can make this work is use a labelFunction eg mx:DataGridColumn dataField=array1[1] labelFunction=something/ Just wondered if there was any other way? TIA Bod
[flexcoders] Re: DataGridColumn widths not correct when Datgrid horizontalScrollPolicy=auto
Hi Alex, DataGrid doesn't leave empty space on the right of the last column. It always stretches the last column to the right edge. Hmm.. that's not ideal for me. My last 2 columns have Image itemRenderers. For look and feel purposes, the column should be the same widths. It would be the same scenario if the itemRenderers were CheckBoxes (centre aligned) ...you wouldn't want one column looking bigger than the other. Apart moving these 2 columns from the end to some where in the middle, is there a workaround for this? Thanks for your help and knowledge. regards bod --- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: DataGrid doesn't leave empty space on the right of the last column. It always stretches the last column to the right edge. Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of bhaq1972 Sent: Thursday, August 06, 2009 8:17 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] DataGridColumn widths not correct when Datgrid horizontalScrollPolicy=auto Hi List When DataGrid horizontalScrollPolicy=auto, the DatagridColumn widths are not correct. When I scroll right(on the dg horizontalscroll bar). I can see my last 2 columns are not the same width (eventhough i set them both to 20). When horizontalScrollPolicy=off .both widths are the same What am I missing? Any ideas? regards bod
[flexcoders] DataGridColumn widths not correct when Datgrid horizontalScrollPolicy=auto
Hi List When DataGrid horizontalScrollPolicy=auto, the DatagridColumn widths are not correct. When I scroll right(on the dg horizontalscroll bar). I can see my last 2 columns are not the same width (eventhough i set them both to 20). When horizontalScrollPolicy=off .both widths are the same What am I missing? Any ideas? regards bod
[flexcoders] how to check if xml attribut value exists
var myXML:XML = root node label=hello1something/node node label=hello2something/node /root; when I do trace(myXML..node.(@label=hello1).toXMLString()); its okay, but if i search for a @label which doesn't exists eg trace(myXML..node.(@label=hello3).toXMLString()) i get a runtime error - TypeError: Error #1088: The markup in the document following the root element must be well-formed. How can I stop this runtime error, when I am looking for a non existant attribute value
[flexcoders] Setting Tree.selectedItem
I'm trying to set the selectedItem for the given example. But I'm having all sorts of problems. The tree's dataprovider is XML. I'm only interested in selecting the child nodes (@label == Receipt)that means I have to expand the menu as well. Can someone give me some ideas? Code - mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Button label=test click=test()/ mx:Tree id=menuTree labelField=@label width=40% height=90% showRoot=false dataProvider={menu_data}/ mx:Script ![CDATA[ public function test():void { //this is failing miserably- doesn't expandItem and adds // some other rubbish to the tree menuTree.selectedItem = XML(menuTree.dataProvider[0]).node.node.(@label == Receipt); } ]] /mx:Script mx:XML id=menu_data xmlns= MenuOne node label=Receiving node title=Purchase Order label=Purchase Order / node title=Receipt label=Receipt / /node node label=Inventory node title=Stock SKU label=Stock SKU / node title=Stock Slot label=Stock Slot / /node /MenuOne /mx:XML /mx:Application
[flexcoders] Re: Setting Tree.selectedItem
Problem solved. This is what I wanted public function test():void { // Select Receipt node - first Expand menu then selectItem menuTree.expandItem(XML(menuTree.dataProvider[0]..node.(@label == Receipt)).normalize().parent(), true, true); menuTree.selectedItem = XML(menuTree.dataProvider[0]..node.(@label == Receipt)).normalize(); } --- In flexcoders@yahoogroups.com, bhaq1972 mbha...@... wrote: I'm trying to set the selectedItem for the given example. But I'm having all sorts of problems. The tree's dataprovider is XML. I'm only interested in selecting the child nodes (@label == Receipt)that means I have to expand the menu as well. Can someone give me some ideas? Code - mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Button label=test click=test()/ mx:Tree id=menuTree labelField=@label width=40% height=90% showRoot=false dataProvider={menu_data}/ mx:Script ![CDATA[ public function test():void { //this is failing miserably- doesn't expandItem and adds // some other rubbish to the tree menuTree.selectedItem = XML(menuTree.dataProvider[0]).node.node.(@label == Receipt); } ]] /mx:Script mx:XML id=menu_data xmlns= MenuOne node label=Receiving node title=Purchase Order label=Purchase Order / node title=Receipt label=Receipt / /node node label=Inventory node title=Stock SKU label=Stock SKU / node title=Stock Slot label=Stock Slot / /node /MenuOne /mx:XML /mx:Application
[flexcoders] Re: Drag Drop - maually show red cross or green plus icon
Its actually for the cursor feedback ...and i'm not getting much lick with the showfeedback method. thanks anyway bod --- In flexcoders@yahoogroups.com, jossminker jossmin...@... wrote: From your message i take it you mean you want to change the drag proxy image (for something you are already dragging) and not the cursor? in this case you need to look at DragSource. something like this: var dragInitiator:Image=Image(event.currentTarget); var ds:DragSource = new DragSource(); ds.addData(dragInitiator, img); DragManager.doDrag(dragInitiator, ds, event); see the help under Drag and rop examples. there are also other posts on this in flexcoders, but this only applies if you are indeed changing the dragproxy and not the cursor. if it is the cursor you want then as the previous reply says you need to look DragManager showFeedback but I'll admit i did not have a whole lot of luck with this myself. hope this helps joss --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: During a dragOver event I want to manually show the green plus or red cross icon on the dragProxy image. How do I do that? thanks
[flexcoders] Re: Drag Drop - maually show red cross or green plus icon
Thanks but this doesn't seem to work for me. Is there anything else. Regards bod --- In flexcoders@yahoogroups.com, Adrian Williams adri...@... wrote: Hi there... You need to take a look at this: DragManager.showFeedback(DragManager.MOVE); hth adrian bhaq1972 wrote: During a dragOver event I want to manually show the green plus or red cross icon on the dragProxy image. How do I do that? thanks
[flexcoders] Re: How can I edit the datagrid header?
Check out the property headerRender on DatagridColumn. mx:DataGridColumn headerRenderer=mx.controls.TextInput/ --- In flexcoders@yahoogroups.com, ujjwalkanti_manna ujjwalkanti_ma...@... wrote: Hi All, I am new in the flex world.Could any of you tell us how can I make the datagrid column header as editable.So that after user edit the column header it will be saved in database. As I don't know so much about flex so it would be great for me if any of u atlease provide some hint regarding this issue. I look forward to get any response from you. Regards, Kanti
[flexcoders] Re: Flex and Reporting
Have you seen Stimulsoft. One of things it has is a Flex runtime designervery nice. --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_ano...@... wrote: Hi everyone, I am totally amazed at the cool front-end UI things that could be done in Flex. I have been dabbling a lot on Flex and steadily getting the hang of it. Anyway, one thing which I am looking for is on creating and printing reports. I am looking for some resources on how to achieve such things, like: 1. Datagrid - creating a pdf file, open up in the swf application as well. 2. Crosstab reports 3. Executive summaries 4. Free-Form reports Basically, am looking on how I would be able to design/generate reports which could be used in a Flex application. I would certainly welcome advise and feedback on this. Resources for further explorations on reporting would also be appreciated. Thanks.
[flexcoders] Drag Drop - maually show red cross or green plus icon
During a dragOver event I want to manually show the green plus or red cross icon on the dragProxy image. How do I do that? thanks
[flexcoders] Datagrid - Drag and Drop individual cells
Hi everyone. Is it possible to drag and drop individual cells within a DataGrid (or any other List container)? for eg. drag cell [col1,row1] to [col3, row1] .it could be multiple cells. Any help would be appreciated. regards bod
[flexcoders] Re: Adding tabs dynamically
TabNavigatorObj.addChildAt(this, TabNavigatorObj.getChildren().length - 1); Just a guessI think your problem is TabNavigatorObj.getChildren().length Its not what you think it is (do a trace on it). instead, try using TabNavigatorObj.addChild(this); --- In flexcoders@yahoogroups.com, markgoldin_2000 markgoldin_2...@... wrote: From the inside of a new Tab: TabNavigatorObj.addChildAt(this, TabNavigatorObj.getChildren().length - 1); --- In flexcoders@yahoogroups.com, Sam Lai samuel.lai@ wrote: How are you adding the tabs to the tabnavigator? 2009/4/2 markgoldin_2000 markgoldin_2000@: I am having a problem adding tabs to tabnavigator. While I am going in one order tabs are generated in a different then mine. Here is some code although it's simplified: // Scan thru scanning each zone and add as many as needed zoneNumber = resultXML.children().length(); currentZone = 0; createNextTab(resultXML); private function createNextTab(resultXML:XML):void { if (currentZone zoneNumber) { node = resultXML.zoneconfiguration[currentZone]; var Tab:boxing = new boxing(); Tab.id = node.lineid.toString(); Tab.label = Boxing Area + Tab.id + ; Tab.paramObj.lineid = node.lineid; Tab.attachJobInProgress(boxingareas); callLater(createNextTab, [resultXML]); currentZone++; } } resultXML looks very simple: nodes with lineid. Tab.paramObj.lineid drives IDs of tabs. While I am going from 1 to 6, Tabs have a random order: mostly 2, 1, Hope my problem is clear. Thanks -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Re: Rotate a custom Marker icon with Google Maps Flex API
Sorry I can't remember. It was always quite confusing because there was one for flex and one for flash (and I was only evaluating). Go to the google maps flex api home page. and there is a link (called 'Groups') on the top right. --- In flexcoders@yahoogroups.com, bigdummy504 j...@... wrote: --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: Google maps flex API have their own forum. You can ask the question there...very helpful bunch. Hi, thank you. Could you provide a link? I have not been able to find this group, is it a yahoo or google group? J
[flexcoders] Re: Rotate a custom Marker icon with Google Maps Flex API
Google maps flex API have their own forum. You can ask the question there...very helpful bunch. --- In flexcoders@yahoogroups.com, Jean H. Chandler j...@... wrote: Greetings ladies and gentlemen of Flex, My name is Jean. I'm something of a Flex newby, though I've done a few small Flex Apps successfully which are in deployment. Right now I'm trying to do a project involving the Google Maps API. Currently I have the API working in Flex, I'm testing out the use of overlays and markers and specifically, trying to rotate some arrow- shaped custom markers I put on the map. From seeing this example http://blog.sunild.com/2009/02/custom-google-map-markers-made- easy.html ...of a Flex app with custom markers that rotate, I understand this is possible but I don't know how to do it. I have played around with the Animateproperty effect but I couldn't see any way to do it that way, so I tried using the rotate effect based on an example I found here: http://blog.flexexamples.com/2008/02/27/setting-effects-with- actionscript-in-flex/ So far without luck. I can create code which compiles, and I attempted to rotate the icon object, but it doesn't do anything. My code is posted here: http://www.adobe.com/cfusion/webforums/forum/messageview.cfm? catid=585threadid=1428709 I gather it could also be possible using the Degrafa controls but that is yet another entire layer of complexity. Can anyone help? Is anyone here familiar with using the Google Maps API with Flex? D.
[flexcoders] Re: ToggleButtonBar xml based dataProvider (2)
most definately, just loop thru the dataprovider during the ToggleButtonBar's initialize or creationComplete event and set each button's icon. -- In flexcoders@yahoogroups.com, markgoldin_2000 markgoldin_2...@... wrote: Yeah, I see it now too. Do think it's possible to set an icon for a button at run time? --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: i'm no expert but i'd suggest not using XML as the dataprovideronly because of what the docs say and looking at the code prior to line 378 in NavBar.as I modified your dataprovider to look like this mx:dataProvider mx:Array mx:Object id=b4 label=G2 online=true icon=@Embed.../ etc.. /mx:Array /mx:dataProvider And it works fine. --- In flexcoders@yahoogroups.com, markgoldin_2000 markgoldin_2000@ wrote: Still can't understand why the following does not work: code: mx:ToggleButtonBar id=floorlines direction=vertical iconField=icon horizontalGap=5 itemClick=clickHandler (event); labelField=label creationComplete=floorLinesData(); height=100% fontSize=8 fontWeight=bold/ data: root lines id4/id labelG2/label onlinetrue/online icon@Embed('D:/projects/sfcs/assets/status_online.png')/icon /lines lines /root code: floorlines.dataProvider = resultXML.lines; error: Error: ERROR: The dataProvider of 'floorlines' must not contain objects of type flash.display.DisplayObject. at mx.controls::NavBar/set dataProvider()[C:\autobuild\3.2.0 \frameworks\projects\framework\src\mx\controls\NavBar.as:378] at tasktracking/floorLinesShowData() [D:\projects\sfcs\tasktracking\src\tasktracking.mxml:107] at modulecode::Classes/httpResult() [D:\projects\sfcs\UFDCommonLib\src\modulecode\Classes.as:62] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::di spatchRpcEvent()[C:\autobuild\3.2.0 \frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:170] at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::re sultHandler()[C:\autobuild\3.2.0 \frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:193] at mx.rpc::Responder/result()[C:\autobuild\3.2.0 \frameworks\projects\rpc\src\mx\rpc\Responder.as:43] at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.2.0 \frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:74] at DirectHTTPMessageResponder/completeHandler() [C:\autobuild\3.2.0 \frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.a s:403] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete() Thanks
[flexcoders] Re: Reading compressed file in AS 3
For background, what I'm trying to experiment with is compressing XML on the server-side and decompressing it on the client-side to see if I can improve performance. If anyone has thoughts or suggestions on this topic, I'm all ears. (AMF is not supported on the server I'm using, so AMF-over-HTTP is not an option.) if your interested, i've compressed an xml string in flex like this var byteData:ByteArray = new ByteArray(); byteData.writeUTFBytes(Rootsomething //Root); byteData.position = 0; byteData.compress(); Then passed this ByteArray to a c# webservice, where i uncompressed it (using sharpziplib library) like this. // Unzip (c# code) - myBytes are the compressed bytes from flex byte[] writeData = new byte[4096]; Stream inStream = new InflaterInputStream(new MemoryStream(myBytes)); while (true) { iSize = inStream.Read(writeData, 0, writeData.Length); if (iSize == 0) { break; } stringXML += System.Text.Encoding.ASCII.GetString(writeData, 0, iSize); }
[flexcoders] Re: ToggleButtonBar - disable buttons
--- In flexcoders@yahoogroups.com, markgoldin_2000 markgoldin_2...@... wrote: Can I disable some buttons in ToggleButtonBar control? Thanks sure...something like this would do it Button(myToggleButtonBar.getChildAt(1)).enabled = false;
[flexcoders] Re: ToggleButtonBar xml based dataProvider (2)
i'm no expert but i'd suggest not using XML as the dataprovideronly because of what the docs say and looking at the code prior to line 378 in NavBar.as I modified your dataprovider to look like this mx:dataProvider mx:Array mx:Object id=b4 label=G2 online=true icon=@Embed.../ etc.. /mx:Array /mx:dataProvider And it works fine. --- In flexcoders@yahoogroups.com, markgoldin_2000 markgoldin_2...@... wrote: Still can't understand why the following does not work: code: mx:ToggleButtonBar id=floorlines direction=vertical iconField=icon horizontalGap=5 itemClick=clickHandler (event); labelField=label creationComplete=floorLinesData(); height=100% fontSize=8 fontWeight=bold/ data: root lines id4/id labelG2/label onlinetrue/online icon@Embed('D:/projects/sfcs/assets/status_online.png')/icon /lines lines /root code: floorlines.dataProvider = resultXML.lines; error: Error: ERROR: The dataProvider of 'floorlines' must not contain objects of type flash.display.DisplayObject. at mx.controls::NavBar/set dataProvider()[C:\autobuild\3.2.0 \frameworks\projects\framework\src\mx\controls\NavBar.as:378] at tasktracking/floorLinesShowData() [D:\projects\sfcs\tasktracking\src\tasktracking.mxml:107] at modulecode::Classes/httpResult() [D:\projects\sfcs\UFDCommonLib\src\modulecode\Classes.as:62] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::di spatchRpcEvent()[C:\autobuild\3.2.0 \frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:170] at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::re sultHandler()[C:\autobuild\3.2.0 \frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:193] at mx.rpc::Responder/result()[C:\autobuild\3.2.0 \frameworks\projects\rpc\src\mx\rpc\Responder.as:43] at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.2.0 \frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:74] at DirectHTTPMessageResponder/completeHandler() [C:\autobuild\3.2.0 \frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.a s:403] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete() Thanks
[flexcoders] Re: Header Renderer
You have to embed a mx:Script tag inside the Component tag i.e mx:Component mx:Label ... mx:Script etc /mx:Component --- In flexcoders@yahoogroups.com, markgoldin_2000 markgoldin_2...@... wrote: I am specifying a heder renderer in the following way: mx:DataGridColumn dataField=endtime width=70 sortable=false mx:headerRenderer mx:Component mx:Label id=signout text=End Time/ /mx:Component /mx:headerRenderer /mx:DataGridColumn I am also trying to specify a click listener like this: ... id=signout text=End Time click=signOut() that generates a compiler error: 1180: Call to a possibly undefined method signOut. Does that mean that the only way of getting this working is to go to a custom header renderer? Thanks
[flexcoders] Re: Header Renderer
Yes (shown below). But I actually prefer the other Fotis' suggestionbut you will have to ensure signOut() is defined in the parentDocument. mx:headerRenderer mx:Component mx:Label text=End Time click=signOut()/ mx:Script public function signOut():void { } /mx:Script /mx:Component /mx:headerRenderer --- In flexcoders@yahoogroups.com, markgoldin_2000 markgoldin_2...@... wrote: Should it be like this: mx:headerRenderer mx:Component mx:Label text=End Time/ mx:Script /mx:Script /mx:Component /mx:headerRenderer --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: You have to embed a mx:Script tag inside the Component tag i.e mx:Component mx:Label ... mx:Script etc /mx:Component --- In flexcoders@yahoogroups.com, markgoldin_2000 markgoldin_2000@ wrote: I am specifying a heder renderer in the following way: mx:DataGridColumn dataField=endtime width=70 sortable=false mx:headerRenderer mx:Component mx:Label id=signout text=End Time/ /mx:Component /mx:headerRenderer /mx:DataGridColumn I am also trying to specify a click listener like this: ... id=signout text=End Time click=signOut() that generates a compiler error: 1180: Call to a possibly undefined method signOut. Does that mean that the only way of getting this working is to go to a custom header renderer? Thanks
[flexcoders] Re: Creating a DataProvider by dynamic loading
If you want to add columns dynamically, you need something like this var colNum:int=5 for(var i:int=0;icolNum;i++) { var col:DataGridColumn = new DataGridColumn(); col.dataField = some value1; col.headerText = some value2; myDataGrid.columns.push(col); } you'd then generate your dataProvider (could be an ArrayCollection, Array, XML, whatever) myDataGrid.dataProvider = myDataProvider; hope this helps bh --- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... wrote: Hi helper, I have a DataGrid and I need to feed its DataProvider dynamically, I have difficulties doing that. my columns: var columns:ArrayCollection = new ArrayCollection(); columns.addItem(parent); columns.addItem(cell1); columns.addItem(date); columns.addItem(cell2); and differnt data for each row. How do I set all this columns and data (that need to be feed into ArrayCollections as well) into a main ArrayCollection that will have the following structure? parent:'root1',col1:100,date:myObject[0],col2:33 parent:'root1',col1:5,date:myObject[1],col2:21 parent:'root2',col1:11,date:myObject[2],col2:5 Here the column name and values are static, I need all to be dynamic, to be sent to the DataGrid as the DataProvider, Thanks Jo
[flexcoders] Re: Creating a DataProvider by dynamic loading
Can I set it dynamically without the need to set columnName:columnValue statically? Sorry i'm a bit unclear. Another suggestion ... You want to create DatgridColumns based on whats in the DataProvider. If your dataProvider Array is something like the following var myArray:Array = [{parent:'root1',col1:100,date:myObject[0],col2:33}, {parent:'root1',col1:5,date:myObject[1],col2:21}, {parent:'root2',col1:11,date:myObject[2],col2:5}]; then why not do something like this var row:Object = myArray[0]; for(var obj1:Object in row) { var col:DataGridColumn = new DataGridColumn(); col.dataField = obj1; } --- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... wrote: Thanks man, I am doing something like you mensioned for columns, my problem is the dataprovider itself that I set to the DataGrid. Can I set it dynamically without the need to set columnName:columnValue statically? To be clear :) My current dataprovider is set accornigly in an Array: {parent:'root1',col1:100,date:myObject[0],col2:33}, {parent:'root1',col1:5,date:myObject[1],col2:21}, {parent:'root2',col1:11,date:myObject[2],col2:5} I need to build it dymanically because the column names(the ones before the semicolon) can be different and as I said I get them and the values(objects) from Arrays. Thanks again Jo --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: If you want to add columns dynamically, you need something like this var colNum:int=5 for(var i:int=0;icolNum;i++) { var col:DataGridColumn = new DataGridColumn(); col.dataField = some value1; col.headerText = some value2; myDataGrid.columns.push(col); } you'd then generate your dataProvider (could be an ArrayCollection, Array, XML, whatever) myDataGrid.dataProvider = myDataProvider; hope this helps bh --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ wrote: Hi helper, I have a DataGrid and I need to feed its DataProvider dynamically, I have difficulties doing that. my columns: var columns:ArrayCollection = new ArrayCollection(); columns.addItem(parent); columns.addItem(cell1); columns.addItem(date); columns.addItem(cell2); and differnt data for each row. How do I set all this columns and data (that need to be feed into ArrayCollections as well) into a main ArrayCollection that will have the following structure? parent:'root1',col1:100,date:myObject[0],col2:33 parent:'root1',col1:5,date:myObject[1],col2:21 parent:'root2',col1:11,date:myObject[2],col2:5 Here the column name and values are static, I need all to be dynamic, to be sent to the DataGrid as the DataProvider, Thanks Jo
[flexcoders] Re: Creating a DataProvider by dynamic loading
Thanks for your time, realy thats okay. Can you send an example of column array and data array? --- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... wrote: Hi man, I am very sorry to say that I was not clear :( myArray is what I need to create, I dont have it (I just gave as example of what I need to create). This is basically my problem, How to build it based on column array and on data array? Only then I will assign it to the DataGrid Thanks for your time, realy --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: Can I set it dynamically without the need to set columnName:columnValue statically? Sorry i'm a bit unclear. Another suggestion ... You want to create DatgridColumns based on whats in the DataProvider. If your dataProvider Array is something like the following var myArray:Array = [{parent:'root1',col1:100,date:myObject[0],col2:33}, {parent:'root1',col1:5,date:myObject[1],col2:21}, {parent:'root2',col1:11,date:myObject[2],col2:5}]; then why not do something like this var row:Object = myArray[0]; for(var obj1:Object in row) { var col:DataGridColumn = new DataGridColumn(); col.dataField = obj1; } --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ wrote: Thanks man, I am doing something like you mensioned for columns, my problem is the dataprovider itself that I set to the DataGrid. Can I set it dynamically without the need to set columnName:columnValue statically? To be clear :) My current dataprovider is set accornigly in an Array: {parent:'root1',col1:100,date:myObject[0],col2:33}, {parent:'root1',col1:5,date:myObject[1],col2:21}, {parent:'root2',col1:11,date:myObject[2],col2:5} I need to build it dymanically because the column names(the ones before the semicolon) can be different and as I said I get them and the values(objects) from Arrays. Thanks again Jo --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: If you want to add columns dynamically, you need something like this var colNum:int=5 for(var i:int=0;icolNum;i++) { var col:DataGridColumn = new DataGridColumn(); col.dataField = some value1; col.headerText = some value2; myDataGrid.columns.push(col); } you'd then generate your dataProvider (could be an ArrayCollection, Array, XML, whatever) myDataGrid.dataProvider = myDataProvider; hope this helps bh --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ wrote: Hi helper, I have a DataGrid and I need to feed its DataProvider dynamically, I have difficulties doing that. my columns: var columns:ArrayCollection = new ArrayCollection(); columns.addItem(parent); columns.addItem(cell1); columns.addItem(date); columns.addItem(cell2); and differnt data for each row. How do I set all this columns and data (that need to be feed into ArrayCollections as well) into a main ArrayCollection that will have the following structure? parent:'root1',col1:100,date:myObject[0],col2:33 parent:'root1',col1:5,date:myObject[1],col2:21 parent:'root2',col1:11,date:myObject[2],col2:5 Here the column name and values are static, I need all to be dynamic, to be sent to the DataGrid as the DataProvider, Thanks Jo
[flexcoders] Re: Creating a DataProvider by dynamic loading
Not sure, i'll have a play around. Maybe someone else can take a look. --- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... wrote: Hi, This is my columns: var columns:ArrayCollection = new ArrayCollection(); columns.addItem(parent); columns.addItem(cell1); columns.addItem(cell2); columns.addItem(dummy); let say 3 rows: var data_:ArrayCollection = new ArrayCollection; rowData_ = new Map(); rowData_.put(columns[0],root1); rowData_.put(columns[1],55); rowData_.put(columns[2],100); rowData_.put(columns[3],myObject[0]); data_.addItem(rowData_); rowData_ = new Map(); rowData_.put(columns[0],root1); rowData_.put(columns[1],34); rowData_.put(columns[2],10); rowData_.put(columns[3],myObject[1]); data_.addItem(rowData_); rowData_ = new Map(); rowData_.put(columns[0],root1); rowData_.put(columns[1],6); rowData_.put(columns[2],60); rowData_.put(columns[3],myObject[2]); data_.addItem(rowData_); My Map (which is a HashMap): package { import flash.utils.Dictionary; public class Map { private var keysList:Array = new Array(); private var valuesList:Array = new Array(); private var entries:Dictionary = new Dictionary(); public function Map(){ } public function get length():uint { return valuesList.length; } public function get(key:Object):Object { return entries[key]; } public function getKeyAt(index:uint):Object { return keysList[index]; } public function getKeysList():Array { return keysList.slice(); } public function getValueAt(index:uint):Object { return valuesList[index]; } public function getValuesList():Array { return valuesList.slice(); } public function put(key:Object, value:Object):void { entries[key] = value; keysList.push(key); valuesList.push(value); } public function remove(key:Object):void { delete entries[key]; var index:int = keysList.indexOf(key); if (index -1) { keysList.splice(index, 1); valuesList.splice(index, 1); } } } } The result is data_ ArrayCollection that holds a list of column/value hashmap which is good. How do I take this array and translate it to a dataProvider for the DataGrid, or set it differently to the grid? Thanks man --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: Thanks for your time, realy thats okay. Can you send an example of column array and data array? --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ wrote: Hi man, I am very sorry to say that I was not clear :( myArray is what I need to create, I dont have it (I just gave as example of what I need to create). This is basically my problem, How to build it based on column array and on data array? Only then I will assign it to the DataGrid Thanks for your time, realy --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: Can I set it dynamically without the need to set columnName:columnValue statically? Sorry i'm a bit unclear. Another suggestion ... You want to create DatgridColumns based on whats in the DataProvider. If your dataProvider Array is something like the following var myArray:Array = [{parent:'root1',col1:100,date:myObject[0],col2:33}, {parent:'root1',col1:5,date:myObject[1],col2:21}, {parent:'root2',col1:11,date:myObject[2],col2:5}]; then why not do something like this var row:Object = myArray[0]; for(var obj1:Object in row) { var col:DataGridColumn = new DataGridColumn(); col.dataField = obj1; } --- In flexcoders@yahoogroups.com, yossi.baram yossi.baram@ wrote: Thanks man, I am doing something like you mensioned for columns, my problem is the dataprovider itself that I set to the DataGrid. Can I set it dynamically without the need to set columnName:columnValue statically? To be clear :) My current dataprovider is set accornigly in an Array: {parent:'root1',col1:100,date:myObject[0],col2:33}, {parent:'root1',col1:5,date:myObject[1],col2:21}, {parent:'root2',col1:11,date:myObject[2],col2:5} I need to build it dymanically because the column
[flexcoders] Re: Creating a DataProvider by dynamic loading
Hi jo I've had a little play around with what you gave and came up with the following example. Let us know if this is what you want. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Script ![CDATA[ import mx.controls.dataGridClasses.DataGridColumn; import mx.collections.ArrayCollection; import mx.collections.IList; public function startUP():void { var myObject:Object = {0:0, 1:1, 2:2} var columns:ArrayCollection = new ArrayCollection(); columns.addItem(parent); columns.addItem(cell1); columns.addItem(cell2); columns.addItem(dummy); //create columns var colArray1:Array = []; for(var i:int=0;icolumns.length;i++) { var dgCol:DataGridColumn = new DataGridColumn(); dgCol.dataField = columns[i]; colArray1.push(dgCol); } dg.columns = colArray1; //let say 3 rows: var data_:ArrayCollection = new ArrayCollection; var rowData_:Map; rowData_ = new Map(); rowData_.put(columns[0],root1); rowData_.put(columns[1],55); rowData_.put(columns[2],100); rowData_.put(columns[3],myObject[0]); data_.addItem(rowData_); rowData_ = new Map(); rowData_.put(columns[0],root1); rowData_.put(columns[1],34); rowData_.put(columns[2],10); rowData_.put(columns[3],myObject[1]); data_.addItem(rowData_); rowData_ = new Map(); rowData_.put(columns[0],root1); rowData_.put(columns[1],6); rowData_.put(columns[2],60); rowData_.put(columns[3],myObject[2]); data_.addItem(rowData_); // set dg dataProvider var dp1:Array = []; var obj1:Object; for(var j:int=0;jdata_.length;j++) { var map:Map = data_.getItemAt(j) as Map; var meme:Object; obj1 = {}; for(var k:int=0;kdg.columnCount;k++) { meme = dg.columns[k].dataField; obj1[meme.valueOf()] = map.getValueAt(k); } dp1.push(obj1); } dg.dataProvider = dp1; } ]] /mx:Script mx:DataGrid id=dg initialize=startUP()/ /mx:Application
[flexcoders] Re: Creating a DataProvider by dynamic loading
glad I could help. --- In flexcoders@yahoogroups.com, yossi.baram yossi.ba...@... wrote: You are great Thanks man, it works like a charm :) --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: Hi jo I've had a little play around with what you gave and came up with the following example. Let us know if this is what you want. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Script ![CDATA[ import mx.controls.dataGridClasses.DataGridColumn; import mx.collections.ArrayCollection; import mx.collections.IList; public function startUP():void { var myObject:Object = {0:0, 1:1, 2:2} var columns:ArrayCollection = new ArrayCollection(); columns.addItem(parent); columns.addItem(cell1); columns.addItem(cell2); columns.addItem(dummy); //create columns var colArray1:Array = []; for(var i:int=0;icolumns.length;i++) { var dgCol:DataGridColumn = new DataGridColumn(); dgCol.dataField = columns[i]; colArray1.push(dgCol); } dg.columns = colArray1; //let say 3 rows: var data_:ArrayCollection = new ArrayCollection; var rowData_:Map; rowData_ = new Map(); rowData_.put(columns[0],root1); rowData_.put(columns[1],55); rowData_.put(columns[2],100); rowData_.put(columns[3],myObject[0]); data_.addItem(rowData_); rowData_ = new Map(); rowData_.put(columns[0],root1); rowData_.put(columns[1],34); rowData_.put(columns[2],10); rowData_.put(columns[3],myObject[1]); data_.addItem(rowData_); rowData_ = new Map(); rowData_.put(columns[0],root1); rowData_.put(columns[1],6); rowData_.put(columns[2],60); rowData_.put(columns[3],myObject[2]); data_.addItem(rowData_); // set dg dataProvider var dp1:Array = []; var obj1:Object; for(var j:int=0;jdata_.length;j++) { var map:Map = data_.getItemAt(j) as Map; var meme:Object; obj1 = {}; for(var k:int=0;kdg.columnCount;k++) { meme = dg.columns[k].dataField; obj1[meme.valueOf()] = map.getValueAt(k); } dp1.push(obj1); } dg.dataProvider = dp1; } ]] /mx:Script mx:DataGrid id=dg initialize=startUP()/ /mx:Application
[flexcoders] Re: Generated html page backgroundcolour
Does that property actually change the background color in the wrapper, or does the Flex app just cover the entire browser? I do not know offhand. Sorry for the late response (the weekend had begun) Yes it does. If you look at the source for the generated wrapper it shows bgcolor, #ff, One reason why I was struggling (which lead to my posted question) My Application.backgroundColor was defined in an external stylesheet (with all my other styles). But this does not get picked up. It only seems to work when you define it in the mxml tag. --- In flexcoders@yahoogroups.com, Tracy Spratt tspr...@... wrote: Does that property actually change the background color in the wrapper, or does the Flex app just cover the entire browser? I do not know offhand. In a recent thread, someone noted that the browser background stayed the original color for a brief time before the Flex app loaded, and suggested adding an entry to the Additional Compiler Options in the Flex Builder Properties, to actually compile the background color into the wrapper. Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of bhaq1972 Sent: Friday, January 30, 2009 10:12 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Generated html page backgroundcolour I just realized mx:Application backgroundColor=white etc generates the white background in the generated html wrapper --- In flexcoders@yahoogroups.com mailto:flexcoders% 40yahoogroups.com , bhaq1972 mbhaque@ wrote: I have my Flexbuilder set to the default settings. How can I make sure the generated HTML wrapper has a white backgroundColor. I know its something to do with ${bgcolor}. But how do I set this? Any help would be appreciated.
[flexcoders] Generated html page backgroundcolour
I have my Flexbuilder set to the default settings. How can I make sure the generated HTML wrapper has a white backgroundColor. I know its something to do with ${bgcolor}. But how do I set this? Any help would be appreciated.
[flexcoders] Re: Generated html page backgroundcolour
I just realized mx:Application backgroundColor=white etc generates the white background in the generated html wrapper --- In flexcoders@yahoogroups.com, bhaq1972 mbha...@... wrote: I have my Flexbuilder set to the default settings. How can I make sure the generated HTML wrapper has a white backgroundColor. I know its something to do with ${bgcolor}. But how do I set this? Any help would be appreciated.
[flexcoders] Re: mx:RemoteObject loadWSDL() equivalent method
What are you trying to do? What I noticed with mx:WebService, is if a fault occurs, i need to call loadWSDL() before i can reuse the webservice object (maybe its the way i'm using it). So i was thinking is there anything like that for RemoteObject. But its okay, i've decided to re-instantiate the object with all its initial values...and that seems to do the trick. thanks for looking --- In flexcoders@yahoogroups.com, valdhor [EMAIL PROTECTED] wrote: What are you trying to do? A Web Service uses a WSDL to document the objects and methods that the service provides. It would not make sense with a RemoteObject. As an aside, it is not necessary to use a WSDL on the client side. If you know the data structures and methods, you can call a Web Service without the WSDL. I have done this many times. --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: Thats so badly written. My question is - Does the RemoteObject class have a method which is equivalent to WebService class's loadWSDL() method? --- In flexcoders@yahoogroups.com, bhaq1972 mbhaque@ wrote: Does mx:RemoteObject have a loadWSDL() equivalent method like mx:WebService? regards
[flexcoders] mx:RemoteObject loadWSDL() equivalent method
Does mx:RemoteObject have a loadWSDL() equivalent method like mx:WebService? regards