Search Results

Search found 200 results on 8 pages for 'dataprovider'.

Page 2/8 | < Previous Page | 1 2 3 4 5 6 7 8  | Next Page >

  • FLEX: I lose current datagrid selection if I sort differently the items of its dataProvider.

    - by Patrick
    hi, when I sort differently my datagrid items, I lose the current selection. This is the code. I'm using savedSelectedItems array to restore the selectedItems but it doesn't work. How can I save the current selection. private function sortItems(option:String):void { //save selectedItems savedSelectedItems = tagsList.selectedItems; if (option == "tag") sort.fields = [new SortField("tag",true)]; if (option == "popularity") sort.fields = [new SortField("popularity",true)]; fullTagsDataModel.tagsData.sort = sort; fullTagsDataModel.tagsData.refresh(); tagsList.selectedItems = savedSelectedItems; } ... <!-- tags list --> <dataGrid:CheckBoxList id="tagsList" width="100%" height="100%" initialize="tagsList.dataProvider=fullTagsDataModel.tagsData" labelField="tag" itemRenderer="com.CheckBoxListAndDataGrid.CheckBoxRenderer" allowMultipleSelection="true" click="savedSelectedItems = tagsList.selectedItems" />

    Read the article

  • How do I set the dataProvider for an <s:List> component to be an XML file?

    - by Matt Calthrop
    I've got the latest Beta of Adobe Flash Builder 4. I want to use a <s:List> component, and specify the dataProvider as being an XML file. However, after loads of research (including looking at doc links off labs.adobe.com), I still can't figure out how to do it. The XML file will look something like this: <?xml version="1.0" encoding="ISO-8859-1"?> <imageList> <image location="path/to/file1.jpg" /> <image location="path/to/file2.jpg" /> <image location="path/to/file3.jpg" /> </imageList>

    Read the article

  • Verify an event was raised by mocked object

    - by joblot
    In my unit test how can I verify that an event is raised by the mocked object. I have a View(UI) -- ViewModel -- DataProvider -- ServiceProxy. ServiceProxy makes async call to serivce operation. When async operation is complete a method on DataProvider is called (callback method is passed as a method parameter). The callback method then raise and event which ViewModel is listening to. For ViewModel test I mock DataProvider and verify that handler exists for event raised by DataProvider. When testing DataProvider I mock ServiceProxy, but how can I test that callback method is called and event is raised. I am using RhinoMock 3.5 and AAA syntax Thanks -- DataProvider -- public partial class DataProvider { public event EventHandler<EntityEventArgs<ProductDefinition>> GetProductDefinitionCompleted; public void GetProductDefinition() { var service = IoC.Resolve<IServiceProxy>(); service.GetProductDefinitionAsync(GetProductDefinitionAsyncCallback); } private void GetProductDefinitionAsyncCallback(ProductDefinition productDefinition, ServiceError error) { OnGetProductDefinitionCompleted(this, new EntityEventArgs<ProductDefinition>(productDefinition, error)); } protected void OnGetProductDefinitionCompleted(object sender, EntityEventArgs<ProductDefinition> e) { if (GetProductDefinitionCompleted != null) GetProductDefinitionCompleted(sender, e); } } -- ServiceProxy -- public class ServiceProxy : ClientBase<IService>, IServiceProxy { public void GetProductDefinitionAsync(Action<ProductDefinition, ServiceError> callback) { Channel.BeginGetProductDefinition(EndGetProductDefinition, callback); } private void EndGetProductDefinition(IAsyncResult result) { Action<ProductDefinition, ServiceError> callback = result.AsyncState as Action<ProductDefinition, ServiceError>; ServiceError error; ProductDefinition results = Channel.EndGetProductDefinition(out error, result); if (callback != null) callback(results, error); } }

    Read the article

  • Flex LineChart with Multiple Data Providers

    - by Jeremy Mitchell
    Can I create a LineChart with multiple data providers? Since LineSeries has a dataprovider property, I'm assuming the answer is Yes. I would expect something like this to work: <LineChart>     <series>         <LineSeries dataprovider="{dp1}"/>         <LineSeries dataprovider="{dp2}"/>         <LineSeries dataprovider="{dp3}"/>     </series> </LineChart> But, the LineChart only appears to work for me when the dataprovider is assigned to the LineChart. Thanks.

    Read the article

  • trouble accessing non-static functions from static functions in AS3

    - by Dogmatixed
    I have a class containing, among other things, a drop down menu. With the aim of saving space, and since the contents of the menu will never change, I've made a static DataProvider for the whole class that populates each instances menu. I was hoping to populate the list with actual functions like so: tmpArr.push({label:"Details...", funct:openDetailsMenu, args:""}); and then assign tmpArr to the DataProvider. Because the DataProvider is static the function that contains that code also needs to be static, but the functions in the array are non-static. At first it didn't seem like a problem, because when the user clicks on a menu item the drop down menu can call a non-static "executeFunction(funct, args)" on its parent. However, when I try to compile, the static function setting up the DataProvider it can't find the non-static functions being passed. If the compiler would just trust me the code would work fine! The simple solution is to just pass strings and use a switch statement to call functions based on that, but that's big, ugly, inelegant, and difficult to maintain, especially if something inherits from this class. The simpler solution is to just make the DataProvider non-static, but I'm wondering if anyone else has a good way of dealing with this? Making the static function able to see its non-static brethren? Thanks.

    Read the article

  • Sorting and Pagination does not work after I build a custom keyword search that is build using relat

    - by Roland
    I recently started to build a custom keyword search using Yii 1.1.x The search works 100%. But as soon as I sort the columns and use pagination in the admin view the search gets lost and all results are shown. So with otherwords it's not filtering so that only the search results show. Somehow it resets it. In my controller my code looks as follows $builder=Messages::model()->getCommandBuilder(); //Table1 Columns $columns1=array('0'=>'id','1'=>'to','2'=>'from','3'=>'message','4'=>'error_code','5'=>'date_send'); //Table 2 Columns $columns2=array('0'=>'username'); //building the Keywords $keywords = explode(' ',$_REQUEST['search']); $count=0; foreach($keywords as $key){ $kw[$count]=$key; ++$count; } $keywords=$kw; $condition1=$builder->createSearchCondition(Messages::model()->tableName(),$columns1,$keywords,$prefix='t.'); $condition2=$builder->createSearchCondition(Users::model()->tableName(),$columns2,$keywords); $condition = substr($condition1,0,-1) . " OR ".substr($condition2,1); $condition = str_replace('AND','OR',$condition); $dataProvider=new CActiveDataProvider('Messages', array( 'pagination'=>array( 'pageSize'=>self::PAGE_SIZE, ), 'criteria'=>array( 'with'=>'users', 'together'=>true, 'joinType'=>'LEFT JOIN', 'condition'=>$condition, ), 'sort'=>$sort, )); $this->render('admin',array( 'dataProvider'=>$dataProvider,'keywords'=>implode(' ',$keywords),'sort'=>$sort )); and my view looks like this $this->widget('zii.widgets.grid.CGridView', array( 'dataProvider'=>$dataProvider, 'columns'=>array( 'id', array( 'name'=>'user_id', 'value'=>'CHtml::encode(Users::model()->getReseller($data->user_id))', 'visible'=>Yii::app()->user->checkAccess('poweradministrator') ), 'to', 'from', 'message', /* 'date_send', */ array( 'name'=>'error_code', 'value'=>'CHtml::encode($data->status($data->error_code))', ), array( 'class'=>'CButtonColumn', 'template'=>'{view} {delete}', ), ), )); I really do not know what do do anymore since I'm terribly lost, any help will be hihsly appreciated

    Read the article

  • Flex ItemRenderer/Editor ComboBox Issue...Puhleezz Help

    - by Mohit
    Hi EveryOne Beginner in Flex ...Even worse with item renderers... Have managed to add a Combobox to a datagrid using a itemEditor... I want to change the options in a combo box depending on the value selected by the user on a previous combo.. In the combo box i want to display a certain value (Model Name ) but for quering a table i'll pass the corresponding code of the model :(... sounds simple enough ..unfortunately not able to implement it I have found this problem on this site but the solution seems an overkill for my "small" problem..was hoping if anyone could guide me towards a more simpler solution... My xml comes as <item><mstValue>CH1</mstValue><mstRemarks>CARRIER</mstRemarks></item> <item><mstValue>CH2</mstValue><mstRemarks>TRANS</mstRemarks></item> <item><mstValue>CH3</mstValue><mstRemarks>YORK</mstRemarks></item> Now i have been able to show the values in a combo .if user selects CARRIER i want to pass CH1(dont know how to do it with itemeditors)...and then fetch values corresponding to CH1 from a table (second part of the problem)...in the sample below i used this.parentDocument.modelComboChanged(this.selectedItem) to pass the selected value ...instedd i need to pass the code for it which comes from the xml...Pls help this making me go crazy.... <mx:DataGrid id="chillerGrid" dataProvider="{chillerGridDp}" editable="true" itemRollOver="{ComponentUtil.setTooltip(event,this)}" itemRollOut="ComponentUtil.resetTooltip(event)" width="70%" height="160"> <mx:columns> <mx:DataGridColumn id="test" headerText="Model" dataField="model" editorDataField="value" editable="true" backgroundColor="#f4f2bd" width="100" > <mx:itemEditor> <mx:Component> <mx:ComboBox creationComplete="{if(text=='')selectedIndex=0;if(data &amp;&amp; data.contactType!=undefined)text=data.contactType.text();}" change="{if(text == ''){selectedIndex=0;if(data &amp;&amp; data.contactType!=undefined)text=data.contactType.text();};this.parentDocument.modelComboChanged(this.selectedItem)}" dataProvider="{this.parentDocument.arrColl1}" text="mstRemarks" labelField="mstRemarks" editable = "false" > <!--<mx:dataProvider > <mx:String></mx:String> <mx:String>Model1</mx:String> <mx:String>Model2</mx:String> <mx:String>Model3</mx:String> <mx:String>Model4</mx:String> <mx:String>Model5</mx:String> </mx:dataProvider>--> </mx:ComboBox> <!--<components:ComboBoxIn dataProvider="{this.parentDocument.arrColl1}" labelField="mstRemarks" /> --> </mx:Component> </mx:itemEditor> </mx:DataGridColumn> <mx:DataGridColumn headerText="Make" dataField="make" editorDataField="value" editable="true" backgroundColor="#f4f2bd" width="100" > <mx:itemEditor> <mx:Component> <mx:ComboBox creationComplete="{if(text=='')selectedIndex=0;if(data &amp;&amp; data.contactType!=undefined)text=data.contactType.text();}" change="{if(text == ''){selectedIndex=0;if(data &amp;&amp; data.contactType!=undefined)text=data.contactType.text();} }" labelField="@label" editable = "false" > <mx:dataProvider> <mx:String></mx:String> <mx:String>Carrier</mx:String> <mx:String>York</mx:String> <mx:String>Trane</mx:String> </mx:dataProvider> </mx:ComboBox> </mx:Component> </mx:itemEditor> </mx:DataGridColumn> <mx:DataGridColumn headerText="Chillers" dataField="chillers" width="200" editable="true"> <mx:itemEditor> <mx:Component> <mx:TextInput maxChars="49" /> </mx:Component> </mx:itemEditor> </mx:DataGridColumn> </mx:columns> </mx:DataGrid>

    Read the article

  • Flex - Problem with auto resizing datagrid

    - by Marty Pitt
    Hi All I'm trying to create a datagrid which will resize vertically to ensure all the renderers are displayed in full. Additionally, Renderers are of variable height Renderers can resize themselves Generally speaking, the flow of events is as follows : One of the item renderers resizes itself (normally in response to a user click etc) It dispatches a bubbling event which the parent datagrid picks up The DataGrid attempts to resize to ensure that all renderers remain visible in full. I'm currently using this code within the datagrid to calculate the height: height = measureHeightOfItems(0, dataProvider.length ) + headerHeight; This appears to get an incorrect height. I've tried a number of variations including callLater ( to ensure the resize has completed so measure can work correctly), and overriding meausre() and calling invalidateSize() / validateSize(), but neither works. Below are 3 classes which will illustrate the problem. Clicking the button in the item renderers resizes the renderer. The grid should also expand so that all of the 3 renderers are shown in their entirety. Any suggestions would be greatly appreciated. Regards Marty DataGridProblem.mxml (Application file) <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:view="view.*"> <mx:ArrayCollection id="dataProvider"> <mx:String>Item A</mx:String> <mx:String>Item B</mx:String> <mx:String>Item C</mx:String> </mx:ArrayCollection> <view:TestDataGrid id="dg" dataProvider="{ dataProvider }" width="400"> <view:columns> <mx:DataGridColumn dataField="text" /> <mx:DataGridColumn itemRenderer="view.RendererButton" /> </view:columns> </view:TestDataGrid> </mx:Application> view.TestDataGrid.as package view { import flash.events.Event; import mx.controls.DataGrid; import mx.core.ScrollPolicy; public class TestDataGrid extends DataGrid { public function TestDataGrid() { this.verticalScrollPolicy = ScrollPolicy.OFF; this.variableRowHeight = true; this.addEventListener( RendererButton.RENDERER_RESIZE , onRendererResize ); } private function onRendererResize( event : Event ) : void { resizeDatagrid(); } private function resizeDatagrid():void { height = measureHeightOfItems(0, dataProvider.length ) + headerHeight; } } } view.RendererButton.mxml <?xml version="1.0" encoding="utf-8"?> <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Button width="50" height="50" click="onClick()" /> <mx:Script> <![CDATA[ public static const RENDERER_RESIZE : String = "resizeRenderer"; private function onClick() : void { this.height += 20; dispatchEvent( new Event( RENDERER_RESIZE , true ) ); } ]]> </mx:Script> </mx:HBox>

    Read the article

  • Flex DataGrid not Displaying Data

    - by asawilliams
    I have a custom dataGrid that acts more like a 2D list (if that makes sense at all). I am dynamically creating the columns and recreating the dataProvider to suit my needs. While debugging I can see that I am creating the columns and setting them to the dataGrid and creating and setting the dataProvider, but for some reason I am able to see the dataGrid and the columns but not the data. [Bindable] private var mockData:ArrayCollection = new ArrayCollection([ {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}, {value: "425341*"}]); ... <TwoDimensionalList width="100%" height="100%" numColumns="7" numRows="7" dataField="value" dataProvider="{mockData}"/> The snippet of code from the object only contains the important functions, everything else is not important (getters, setters, etc ...). While debugging I checked all the variables in the functions to make sure they were assigned and a value that I was expecting. [Snippet] public class TwoDimensionalList extends DataGrid { ... /** * Creates and sets properties of columns */ private function createColumns():void { var column:DataGridColumn; var cols:Array = this.columns; for(var i:uint=0; i < numColumns; i++) { column = new DataGridColumn("column"+i.toString()); column.dataField = "column"+i.toString(); cols[i]=column; } this.columns = cols; // go to the current gotoPage(this._currentPageNum); } /** * Sets the data for the dataprovider based on the * number of columns, rows, and page number. * * @param pageNum the page number of the data to be viewed in the DataGrids. */ private function gotoPage(pageNum:uint):void { _currentPageNum = pageNum; var startIndex:uint = (pageNum-1)*numColumns*numRows; var data:ArrayCollection = new ArrayCollection(); for(var i:uint=0; i < numRows; i++) { var obj:Object = new Object(); for(var j:uint=0; j < numColumns; j++) { if((i+(j*numRows)+startIndex) < _dataProvider.length) obj["column"+j.toString()] = String(_dataProvider.getItemAt(i+(j*numRows)+startIndex)["value"]); } data.addItem(obj); } this.dataProvider = data; } }

    Read the article

  • FLEX: how to dynamically add LineSeries to CartesianChart

    - by Patrick
    hi, the LineSeries is not dynamically added to my CartesianChart... What's wrong in this code: ... private function chartComplete():void { var ls:LineSeries = new LineSeries(); ls.styleName = 'timeline'; ls.dataProvider = "{dataManager.tagViewTimelineModel.tags.getItemAt(0).yearPopularity}"; ls.yField = 'popularity'; //ls.s = "{new Stroke(0xCC33CC, 2)}"; AllChart.series[0] = ls; } ... <mx:CartesianChart id="AllChart" width="100%" height="100" creationComplete="chartComplete();"> <mx:horizontalAxis><mx:CategoryAxis id="horiz1" dataProvider="['1','2','3','4','5','6','7','8','9','10','11','23','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31']"/></mx:horizontalAxis> <mx:horizontalAxisRenderers><mx:AxisRenderer axis="{horiz1}"/></mx:horizontalAxisRenderers> <mx:verticalAxis><mx:LinearAxis id="vert1" /></mx:verticalAxis> <mx:verticalAxisRenderers><mx:AxisRenderer axis="{vert1}"/></mx:verticalAxisRenderers> <mx:series> <mx:AreaSeries id="timeArea" styleName="timeArea" name="A" dataProvider="{dataManager.tagViewTimelineModel.tags.getItemAt(2).yearPopularity}" areaStroke="{new Stroke(0x0033CC, 2)}" areaFill="{new SolidColor(0x0033CC, 0.5)}" /> </mx:series> </mx:CartesianChart> I can only see the TimeLine if I added it with MXML: <mx:LineSeries styleName="timeLine" dataProvider="{dataManager.tagViewTimelineModel.tags.getItemAt(0).yearPopularity}" yField="popularity" stroke="{new Stroke(0xCC33CC, 2)}" /> But I need to update the view, and add N lines so I cannot do it with MXML. thanks

    Read the article

  • How do I force all Tree itemrenderers to refresh?

    - by Richard Haven
    I have item renderers in an mx.controls.Tree that I need to refresh on demand. I have code in the updateDisplayList that fires for only some of the visible nodes no matter what I do. I've tried triggering a change that they should all be listening for; I have tried clearing and resetting the dataProvider and the itemRenderer properties. private function forceCategoryTreeRefresh(event : Event = null) : void { trace("forceCategoryTreeRefresh"); var prevDataProvider : Object = CategoryTree.dataProvider; CategoryTree.dataProvider = null; CategoryTree.validateNow(); CategoryTree.dataProvider = prevDataProvider; var prevItemRenderer : IFactory = CategoryTree.itemRenderer; CategoryTree.itemRenderer = null; CategoryTree.itemRenderer = prevItemRenderer as IFactory; _categoriesChangeDispatcher.dispatchEvent(new Event(Event.CHANGE)); } The nodes refresh properly when I scroll them into view (e.g. the .data gets set), but I cannot force the ones that already exist to refresh or reset themselves. Any ideas?

    Read the article

  • GWT celltable Simple pager Next and previous buttons

    - by Saritha
    I am working on a CellTable with a SimplePager. My paging works fine in the sense when i set the page size to be 5 only 5 records are being displayed. My question is that do next and previous buttons come by default or do we have to configure them. I have seen the show case example code and i do not see any external configurations . my SimplePager code is as follows: //create pager SimplePager.Resources resources = GWT.create(SimplePager.Resources.class); SimplePager simplePager = new SimplePager(TextLocation.CENTER, resources , false, 0, true); simplePager.setDisplay(cellTableSearchResults); simplePager.setPageSize(5); // create data provider ListDataProvider<GridDTO> dataProvider = new ListDataProvider<GridDTO>(); dataProvider.addDataDisplay(cellTableSearchResults); dataProvider.setList(components); Please help.

    Read the article

  • FLEX: can I use a Repeater inside a Series element ?

    - by Patrick
    hi, can I use mx:Repeater inside mx:Series element ? <mx:series> <mx:AreaSeries id="timeArea" styleName="timeArea" name="A" dataProvider="{dataManager.tagViewTimelineModel.tags.getItemAt(0).yearPopularity}" yField="popularity" areaStroke="{new Stroke(0x0033CC, 2)}" areaFill="{new SolidColor(0x0033CC, 0.5)}" /> <mx:LineSeries styleName="timeLine" dataProvider="{dataManager.tagViewTimelineModel.tags.getItemAt(0).yearPopularity}" yField="popularity" stroke="{new Stroke(0xCC33CC, 2)}" /> </mx:series> I don't compiling errors, but my application just doesn't start. thanks

    Read the article

  • Can't find my bug: Group flat data in Advanced Datagrid w'ont work

    - by Werner
    Hi, i've got an ArrayCollection which is properly displayed in this Advanced Datagrid: <mx:AdvancedDataGrid id="drawingDataDG" editable="true" sortableColumns="true" headerWordWrap="true" sortExpertMode="true" rowCount="8" y="10" right="10" left="10" dataProvider="{model.drawingsData}"> <mx:columns> <mx:AdvancedDataGridColumn headerText="Approved in Week" dataField="ApprovedInWeek" editable="false" visible="true" /> <mx:AdvancedDataGridColumn headerText="DRAWING_PK" dataField="DRAWING_PK" editable="false" visible="false" /> <mx:AdvancedDataGridColumn headerText="Drawing No" dataField="DRAWING_NO" editable="false" visible="true"/> <mx:AdvancedDataGridColumn headerText="Drawing Index" dataField="DRAWING_INDEX" editable="false" visible="true"/> </mx:columns> ` According to this explanation link text I've implemented a GroupingCollection. But it just don't work??? <mx:AdvancedDataGrid id="drawingDataDG" editable="true" sortableColumns="true" headerWordWrap="true" sortExpertMode="true" rowCount="8" y="10" right="10" left="10" initialize="gc.refresh();"> <mx:dataProvider> <mx:GroupingCollection id="gc" source="{model.drawingsData}"> <mx:Grouping> <mx:GroupingField name="ApprovedInWeek"/> </mx:Grouping> </mx:GroupingCollection> </mx:dataProvider> <mx:columns> <mx:AdvancedDataGridColumn headerText="Approved in Week" dataField="ApprovedInWeek" editable="false" visible="true" /> <mx:AdvancedDataGridColumn headerText="DRAWING_PK" dataField="DRAWING_PK" editable="false" visible="false" /> <mx:AdvancedDataGridColumn headerText="Drawing No" dataField="DRAWING_NO" editable="false" visible="true"/> <mx:AdvancedDataGridColumn headerText="Drawing Index" dataField="DRAWING_INDEX" editable="false" visible="true"/> </mx:columns> </mx:AdvancedDataGrid> Please let me know what additional details you may need? Werner

    Read the article

  • Trouble adding video controls to video selected by XML comboBox

    - by user560128
    Hello, it's been a few years since I've touched flash, so perhaps I'm just overlooking something. If anyone could look at the code and offer any suggestions that would be awesome. What's working, I select a video from a combobox that is populated from an XML file, pick the video and it plays. I've been trying to add pause/play, stop, forward and reverse functionality, once I get that to work I also want to add a video scrubber(slider), and previous/next buttons to go to the previous/next video as listed in the xml file. At the moment I have a component button on the stage called playButton, which I'm trying to use for pause/play functionality. Below is my code, the player control is at the very bottom. Thanks. import fl.data.DataProvider; var nc:NetConnection = new NetConnection(); nc.connect(null); var ns:NetStream = new NetStream(nc); var videosXML:XML = new XML(); var loader:URLLoader = new URLLoader(); var request:URLRequest= new URLRequest("xml/videos.xml"); var videos:Array = new Array({label:"Select a Video",data:""}); var client:Object = new Object(); theVideo.attachNetStream(ns); ns.client = client; loader.addEventListener(Event.COMPLETE,loaderOnComplete); loader.load (request); function loaderOnComplete(event:Event):void{ videosXML = new XML(event.target.data); for each (var video:XML in videosXML.video){ videos.push({label:video.name.toString(),data:video.url.toString()}); } moviesCB.dataProvider = new DataProvider(videos); } moviesCB.addEventListener(Event.CHANGE, changeHandler); function changeHandler(event:Event):void { if(ComboBox(event.target).selectedItem.data != ""){ ns.play(ComboBox(event.target).selectedItem.data); } }; client.onMetaData = metadataHandler; function metadataHandler(md:Object):void{ } //player controls playButton.onRelease = function() { ns.pause(); }

    Read the article

  • Flash AS3 loading XML into listbox

    - by Anne
    I am able to load my XML file into flash and trace results. Want to populate listbox with information from xml file. Structure of xml file: <eBorders> <item> <thumb>borderTh/blank_th.jpg</thumb> <file>border/blank.jpg</file> </item> <item> <thumb>borderTh/border1_th.jpg</thumb> <file>border/border1.jpg</file> </item> </eBorders> AS3 code: var myLoader:URLLoader = new URLLoader(); myLoader.load(new URLRequest("xml/borders.xml")); var dp:DataProvider = new DataProvider("borders.xml"); border_lb.dataProvider = dp; border_lb.iconField = "iconSource"; border_lb.rowHeight = 45; function processXML(e:Event):void { myXML = new XML(e.target.data); for(var i:int=0;i<myXML.*.length(); i++){ dp.addItem({iconSource:myXML.item.thumb.[i]}); } } Code is producing error I can't find. Thank you in advance for any help you might offer. Annie

    Read the article

  • How to make the members of my Data Access Layer object aware of their siblings

    - by Graham
    My team currently has a project with a data access object composed like so: public abstract class DataProvider { public CustomerRepository CustomerRepo { get; private set; } public InvoiceRepository InvoiceRepo { get; private set; } public InventoryRepository InventoryRepo { get; private set; } // couple more like the above } We have non-abstract classes that inherit from DataProvider, and the type of "CustomerRepo" that gets instantiated is controlled by that child class. public class FloridaDataProvider { public FloridaDataProvider() { CustomerRepo = new FloridaCustomerRepo(); // derived from base CustomerRepository InvoiceRepo = new InvoiceRespository(); InventoryRepo = new InventoryRepository(); } } Our problem is that some of the methods inside a given repo really would benefit from having access to the other repo's. Like, a method inside InventoryRepository needs to get to Customer data to do some determinations, so I need to pass in a reference to a CustomerRepository object. Whats the best way for these "sibling" repos to be aware of each other and have the ability to call each other's methods as-needed? Virtually all the other repos would benefit from having the CustomerRepo, for example, because it is where names/phones/etc are selected from, and these data elements need to be added to the various objects that are returned out of the other repos. I can't just new-up a plain "CustomerRepository" object inside a method within a different repo, because it might not be the base CustomerRepository that actually needs to run.

    Read the article

  • WPF - List View Row Index and Validation

    - by abhishek
    Hi, I have a ListView with TextBoxes in second column. I want to validate that my text box does not contain a number if the third column(data_type) is "Text". I am unable to do the validation. I tried a few approaches. In one approach I try to handle the MouseDown event and am trying to get the Row number so that I can get the data_type value of that row. I want to us this value in the Validate method. I have been struggling for a week now. Would appreciate if anybody could help. <ControlTemplate x:Key="validationTemplate"> <DockPanel> <TextBlock Foreground="Red" FontSize="20">!</TextBlock> <AdornedElementPlaceholder/> </DockPanel> </ControlTemplate> <Style x:Key="textBoxInError" TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Validation.HasError" Value="true"> <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}"/> </Trigger> </Style.Triggers> </Style> <DataTemplate x:Key="textTemplate"> <TextBox HorizontalAlignment= "Stretch" IsEnabled="{Binding XPath=./@isenabled}" Validation.ErrorTemplate="{StaticResource validationTemplate}" Style="{StaticResource textBoxInError}"> <TextBox.Text> <Binding XPath="./@value" UpdateSourceTrigger="PropertyChanged"> <Binding.ValidationRules> <local:TextBoxMinMaxValidation> <local:TextBoxMinMaxValidation.DataType> <local:DataTypeCheck Datatype="{Binding Source={StaticResource dataProvider}, XPath='/[@id=CustomerServiceQueueName]'}"/> </local:TextBoxMinMaxValidation.DataType> <local:TextBoxMinMaxValidation.ValidRange> <local:Int32RangeChecker Minimum="{Binding Source={StaticResource dataProvider}, XPath=./@min}" Maximum="{Binding Source={StaticResource dataProvider}, XPath=./@max}"/> </local:TextBoxMinMaxValidation.ValidRange> </local:TextBoxMinMaxValidation> </Binding.ValidationRules> </Binding > </TextBox.Text> </TextBox> </DataTemplate> <DataTemplate x:Key="dropDownTemplate"> <ComboBox Name="cmbBox" HorizontalAlignment="Stretch" SelectedIndex="{Binding XPath=./@value}" ItemsSource="{Binding XPath=.//OPTION/@value}" IsEnabled="{Binding XPath=./@isenabled}" /> </DataTemplate> <DataTemplate x:Key="booldropDownTemplate"> <ComboBox Name="cmbBox" HorizontalAlignment="Stretch" SelectedIndex="{Binding XPath=./@value, Converter={StaticResource boolconvert}}"> <ComboBoxItem>True</ComboBoxItem> <ComboBoxItem>False</ComboBoxItem> </ComboBox> </DataTemplate> <local:ControlTemplateSelector x:Key="myControlTemplateSelector"/> <Style x:Key="StretchedContainerStyle" TargetType="{x:Type ListViewItem}"> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="Template" Value="{DynamicResource ListBoxItemControlTemplate1}"/> </Style> <ControlTemplate x:Key="ListBoxItemControlTemplate1" TargetType="{x:Type ListBoxItem}"> <Border SnapsToDevicePixels="true" x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}" Padding="{TemplateBinding Padding}" BorderThickness="0,0.5,0,0.5"> <GridViewRowPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> </Border> </ControlTemplate> <Style x:Key="CustomHeaderStyle" TargetType="{x:Type GridViewColumnHeader}"> <Setter Property="Background" Value="LightGray" /> <Setter Property="FontWeight" Value="Bold"/> <Setter Property="FontFamily" Value="Arial"/> <Setter Property="HorizontalContentAlignment" Value="Left" /> <Setter Property="Padding" Value="2,0,2,0"/> </Style> </UserControl.Resources> <Grid x:Name="GridViewControl" Height="Auto"> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="34"/> </Grid.RowDefinitions> <ListView x:Name="ListViewControl" Grid.Row="0" ItemContainerStyle="{DynamicResource StretchedContainerStyle}" ItemTemplateSelector="{DynamicResource myControlTemplateSelector}" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Source={StaticResource dataProvider}, XPath=//CONFIGURATION}"> <ListView.View > <GridView > <GridViewColumn Header="ID" HeaderContainerStyle="{StaticResource CustomHeaderStyle}" DisplayMemberBinding="{Binding XPath=./@id}"/> <GridViewColumn Header="VALUE" HeaderContainerStyle="{StaticResource CustomHeaderStyle}" CellTemplateSelector="{DynamicResource myControlTemplateSelector}" /> <GridViewColumn Header="DATATYPE" HeaderContainerStyle="{StaticResource CustomHeaderStyle}" DisplayMemberBinding="{Binding XPath=./@data_type}"/> <GridViewColumn Header="DESCRIPTION" HeaderContainerStyle="{StaticResource CustomHeaderStyle}" DisplayMemberBinding="{Binding XPath=./@description}" Width="{Binding ElementName=ListViewControl, Path=ActualWidth}"/> </GridView> </ListView.View> </ListView> <StackPanel Grid.Row="1"> <Button Grid.Row="1" HorizontalAlignment="Stretch" Height="34" HorizontalContentAlignment="Stretch" > <StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Center" Orientation="Horizontal" FlowDirection="RightToLeft" Height="30"> <Button Grid.Row="1" Content ="Apply" Padding="0,0,0,0 " Margin="6,2,0,2" Name="btn_Apply" HorizontalAlignment="Right" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="132" IsTabStop="True" Click="btn_ApplyClick" Height="24" /> </StackPanel > </Button> </StackPanel > </Grid>

    Read the article

  • flex 3 using nested repeaters

    - by ccdugga
    I'm trying to loop through a row of an arraycollection using nested repeater; <mx:Repeater id="rp1" dataProvider="{arrayCollection}"> <mx:Repeater id="rp2" dataProvider="{rp1.currentItem}"> <mx:Button height="49" width="50" label="{rp2.currentItem.name}" /> </mx:Repeater> </mx:Repeater> What im trying to do is make the repeater loop through all the attributes in the currentRow, eg. name,age, address etc. At the moment all i do is call rp2.currentItem.name which explicitly calls out the name of the attribute and then the value is returned. Is it possible instead of explicity naming the attribute to just loop through them all and dispplay button for each using the nested repeater?thanks

    Read the article

  • Having trouble with binding

    - by Tam
    I'm not sure if I'm misunderstanding the binding in Flex. I'm using Cairngorm framework. I have the following component with code like: [Bindable] var _model:LalModelLocator = LalModelLocator.getInstance(); .... <s:DataGroup dataProvider="{_model.friendsSearchResults}" includeIn="find" itemRenderer="com.lal.renderers.SingleFriendDisplayRenderer"> <s:layout> <s:TileLayout orientation="columns" requestedColumnCount="2" /> </s:layout> </s:DataGroup> in the model locator: [Bindable] public var friendsSearchResults:ArrayCollection = new ArrayCollection(); Inside the item renderer there is a button that calls a command and inside the command results there is a line like this: model.friendsSearchResults = friendsSearchResults; Putting break points and stepping through the code I confirmed that this like gets called and the friendsSearchResults gets updated. To my understanding if I update a bindable variable it should automatically re-render the s:DataGroup which has a dataProvider of that variable.

    Read the article

  • ArrayCollection error in Flex does not accept single XML nodes - alternatives?

    - by Rees
    hello, i get this error when i retrieve an XML that only has 1 node (no repeating nodes) and i try to store in an ArrayCollection. -When I have MORE than 1 "name" nodes...i do NOT get an error. TypeError: Error #1034: Type Coercion failed: cannot convert "XXXXXX" to mx.collections.ArrayCollection. this error occurs as the line of code: myList= e.result.list.name; Why can't ArrayCollection work with a single node? I'm using this ArrayCollection as a dataprovider for a Component -is there an alternative I can use that will take BOTH single and repeating nodes as well as work as a dataprovider? Thanks in advance! code: [Bindable] private var myList:ArrayCollection= new ArrayCollection(); private function getList(e:Event):void{ var getStudyLoungesService:HTTPService = new HTTPService(); getStuffService.url = "website.com/asdf.php"; getStuffService.addEventListener(ResultEvent.RESULT, onGetList); getStuffService.send(); } private function onGetList(e:ResultEvent):void{ myList= e.result.list.name; }

    Read the article

  • Flex Validator -- Show Red Error Border on DataGrid Cell

    - by gmoniey
    I can successfully add a validator on an item in my datagrid, by passing in the particular element in the dataProvider to the validator, but I can't get the red border to show up around the cell if the validation fails. I have stepped through the validator, and confirmed that it is passing back a failure, but I can't figure out why the red error border doesn't show up. I have a feeling its because I am passing the item in my dataProvider as the validator source, rather than the 'cell' item, but I can't find a way to access the cell. Thanks.

    Read the article

  • How to set tooltip for buttonbar button

    - by donpal
    I have a buttonbar that has 3 buttons. I'm trying to set a tooltip for each of the buttons, but not sure where. The ButtonBar itself has a skin, which in turn includes a skin for each of the buttons. <s:ButtonBar id="bb" selectedIndex="0" skinClass="skins.bbSkin"> <s:dataProvider> <s:ArrayList> <fx:Object label="item1" /> <fx:Object label="item2" /> <fx:Object label="item3" /> </s:ArrayList> </s:dataProvider> </s:ButtonBar> The skin for the buttonbar is skins.bbSkin The skin inside it for each button is skins.bbbSkin

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8  | Next Page >