To access the dataprovider of mxml component.

Hello

I have a dataprovider and want to access the data of mxml component.

Basically, I

ActionScript:

[

Bindable ]

private

var dp : Collection ArrayCollection;

private

function dp_handler(e:ResultEvent):Sub

{

DP = e.result

as Collection ArrayCollection;

}

I wanted to access RFP since using the mxml component

< mx:script >

<! [CDATA]

mx.core.Application;

LBL. Text = Application.application.dp.getItemAt (0) .fieldname;

[]] >

< mx:Label

id=" LBL " x=" 51 " y=" 136 " />

He continues to tell me dp is unknown property.  No idea what I am doing wrong?

RFP to make public, not private.

Tags: Flex

Similar Questions

  • Access the ArrayCollection class MXML ActionScript collection?

    I have a MXML file that has a collection for my tree component arraycollection. I am overriding the updateDisplayList function to add lines to all of my nodes in the tree... However, I can't seem to understand how to access this ArrayCollection collection of inside the actionscript class?

    I tried the methods used to pass variables between two MXML files (like a popup window - which I've used in the past and it works very well).

    My actionscript class code is almost identical to this example here:

    http://www.iepl.NET/treeControlSample/treeControlSample.html

    In the example above, the data is static, but sometimes my data's going to change and I need to access the set dataProvider (collection ArrayCollection) in order to make the lines work well... This has been very frustrating for me! :)

    If someone knows a better way to reach gettign lines for brothers and sisters in a tree... Please let me know!

    Any help would be super duper awesome!

    I found the solution to this. My problem was similar to cheftimo was seen in this post:

    http://www.Adobe.com/cfusion/webforums/Forum/MessageView.cfm?forumid=60&CATID=585&ThreadId = 1367784 & enterthread = y

    The answer is to import the component you are trying to access the variable from and then call using mx.core.Application ' Application.application.'

    Thanks to Greg Lafrance!

  • To access the DataGrid currentTarget by a dataGridColumn button

    I'm trying to access the line item clicked of in a datagrib button. Any thoughts? It seems that accept mouseevent or event...

                   public function onDeleteItem(e:Event):void{
                        trace(e.currentTarget.parent);     
                   }
    <mx:DataGridColumn headerText="Remove" width="60">
                                  <mx:itemRenderer>
                                       <mx:Component>
                                             <mx:Box horizontalAlign="center" verticalAlign="middle">     
                                                  <mx:Button skin="@Embed('assets/remove_icon.png')" 
                                                       buttonMode="true" scaleX=".6" scaleY=".6" click="outerDocument.onDeleteItem(event)" />           
                                             </mx:Box>
                                       </mx:Component>
                                  </mx:itemRenderer>
                             </mx:DataGridColumn>
    
    

    You will need to access the dataProvider using the DataGrid selectedItem property.

    
    
      
        
      
      
        
          
            
              
                
              
            
          
        
      
      
    
    

    If this post answers your question or assistance, please mark it as such.

    Greg Lafrance
    www.ChikaraDev.com

    Support and Flex development services

  • How to access the id of the component from a different mxml?

    I tried to put the data in a DataGrid control to a different mxml, but the compiler said that there is a problem, like this:

    the components/FileDataGrid.mxml:

    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" 
         xmlns:s="library://ns.adobe.com/flex/spark" 
         xmlns:mx="library://ns.adobe.com/flex/mx" >
    
        <mx:DataGrid x="150" y="50" id="dgFile">       <mx:columns>
             <mx:DataGridColumn headerText="COL"/>
           </mx:columns>
        </mx:DataGrid>
     
    </s:Group>
    
    

    the main mxml:

    <?xml version="1.0" encoding="utf-8"?>
    <mx: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"
              xmlns:custom="components.*" layout="absolute">
         <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         
         <fx:Script>
              <![CDATA[
                   
                   private function loadDG():void
                   {
                        var arrFile:Array= new Array("abc","123");
                        
                        dgFile.dataProvider = arrFile;
                        
                        trace( "The data has successfully loaded" );
                   }
    
              ]]>
         </fx:Script>
         
         <s:Button  x="300" y="50" label="Load"  click="loadDG()" />
    
         <custom:FileDataGrid/>
    
    </mx:Application>
    

    The compile error is:

    Several markers to this line:
    -1120: access of undefined property dgFile.
    -arrFile

    Can someone tell me, how?

    Thank you very much!

    Hi, you cannot access it. To access, first give the id for the custom component that you have added.

    That is to say

    
    

    Then you can view this script,

    custFDG.dgFile.dataProvider = arrFile;
    

    Hope this work shud very well.

    Thank you.

    -

    Afonso

  • Question on access to the dataProvider of a converter of element Info

    Hello

    I've been reading for some time on this topic and a lot of different information.

    I need to know how to access the data of a dataprovider of an itemRenderer.

    I want to do is use a checkbox in a DataGrid control, or possibly a ComboBox as part of rendering.

    I need to understand, for example, how to set the CheckBox.label = to a certain field in the data provider.

    The data provider is assigned, of course, for the parent component, in this case, the comboBox or dataGrid control.

    I saw the signs pointing to the idea that the 'data' field shows this value, but I do not see this value in one of the spark components.

    So, I guess my question is double:

    1. how to access information from a rendering in general item data provider?

    2. how to access the data provider info using spark components?

    Thanks in advance!

    Mx components could only be dropped as an itemRenderer.  There were

    General enough to it that we decided to not do that at the point of spark

    rendering engines.  Instead, you can encapsulate a component in an ItemRenderer and link to

    the data of the ItemRenderer property.  Or, if you really want to optimize, you

    can do the job to the subclass and to upgrade a component to implement

    IItemRenderer.

  • How to make the child controls private component composite mxml?

    Hi all
    If I create a custom composite MXML component in Flex, in this case based on mx:Form, how to hide internal controls?

    If I do not give any child a "id" tag, the host application will not see the child tags, fine.
    But if I do not give ID, the host application can point to the tags of the child (labels, entered text, etc.) directly.

    If the custom component is made in ActionScript, I could declare child controls with the "private" access modifier
    But how do I do that in MXML? Is this possible?

    Any help would be thank you very much

    A MXML component is by default public if an id is assigned. There have been a number of requests to allow exactly what you're asking, i.e. of access modifiers in the MXML. It's something I think that Flex team on, but is not resolved.

    TS

  • How can we access the value of the field in a line removed in the buffer of the component?

    In the PeopleSoft component buffer when it removes a parent row children lines are also deleted, therefore, not possible to access the value of the field of these lines.

    Example: If we have RECORD1 at level 1 and RECORD2 (which contains the INCIDENT_NBR field) at level 2.

    If a row is deleted at level 1, level 2 lines are also deleted, but before delete, I need access to the value of INCIDENT_NBR and make sure no line (s) not many for this value in a third record record RECORD3.

    If any line exist in the RECORD3 record an error message should appear in the case otherwise the delete process can go.

    I put the peoplecode in RECORD2. INCIDENT_NBR. SavePreChange (at the record level) because this control must be carried out in all cases for all the component where my RECORD2 record is used.

    When I display the value of the field I always get a null (00000000 digital).

    It is possible that in PL/SQL within a trigger, but unfortunately in this case, I can not catch the error produced by RAISE_APPLICATION_ERROR (-20000, 'Suppression of an incident not allowed when there are dagnostics'); in Peoplecode.

    Does anyone know if there is a way to get the values of the fields in the deleted lines?

    Thank you

    A rowset object has two properties

    ActiveRowCount

    All lines of lines in an exclusive set of deleted rows

    Number of lines

    All lines of a set of lines included the deleted rows.

    So I would say, to loop through all lines and check for deleted rows and make any desired logic, something like:

    For & i = 1 to & rs. Number of lines

    & line = & rs. GetRow (&i);)

    If & row. IsDeleted then

    & rec = & rank. GetRecord (1);

    & fld = & rec. GetField (FIELD. YOURFIELD);

    / logical necessary * /.

    End - If;

    -End;

  • Could not access the value of the component off ValueChangeListener

    In many cases, I need to use the value of some UIComponent during execution in many places in the application. But the problem is that I could not access the value of the component outside the ValueChangeListener of this component. I tried to store this value in a temporary local variable, I also tried to use the opportunity to link , but it did not work.

    This thread changes made on the ValueChangeListener can't think where else

    said I should go ahead everything in the ValueChangeListener but is not useful in my case and it's really limit my choice later.

    So question is: How to access the value of the element external ValueChangeListener?

    I use Jdeveloper with ADF 11.1.2.3 technology

    Hello

    You can create a bean (depending on the application, choose the scope), add a variable with accessors and then use it in the 'value' property of the component.

    Arun-

  • How to access the elements in main.mxml file ActionScript?

    I'm having problems creating a panel using the Extension Builder SDK. It seems that all the examples explain how a CS5 document using a control panel, but I found no examples of how to control the items in the Panel via ActionScript code.   Furthermore, we use CS Extension Builder SDK with Flash Builder 4.  Here's a simple example of were I'm stuck.

    I create a project Extension generator for a panel of PS named: 'CSExtensionTest '.  In the main.mxml file create a button with id = "btnPSCode".

    ****************************************************************************************** *****************************************

    File:

    hand. MXML

    ****************************************************************************************** *****************************************

    <? XML version = "1.0" encoding = "utf-8"? >

    < mx:Application

    ' xmlns:mx = ' http://www.Adobe.com/2006/MXML " " layout ="absolute" historyManagementEnabled = "false""">

    < mx:Script >

    <! [CDATA]

    [

    Bindable ]

    private var hostName:String = HostObject.mainExtension;

    []] >

    < / mx:Script >

    "" < mx:VBox height = "100%" width ="100%" verticalAlign = "middle" horizontalAlign ="center">

    " < mx:Button id ="btnPSCode"label ="PS code run"click ="CSExtensionTestPhotoshop.run ()"enabled =" hostName.indexOf{('photoshop') >-1}"/ >

    " < mx:Button id ="btnJSXCode"label ="code JSX run"click ="CSExtensionTestJSX.run ()"/ > "

    < / mx:VBox >

    < / mx:Application >

    ****************************************************************************************** *****************************************

    How can I access the properties of this element in the CSExtensionTesJSX.as file?

    ****************************************************************************************** *****************************************

    File:

    CSExtensionTesJSX.as

    ****************************************************************************************** *****************************************

    package

    {

    Import com.adobe.csxs.core.CSXSInterface;

    Import com.adobe.csxs.core.csxs_internal;

    Import com.adobe.csxs.types.SyncRequestResult;

    Import mx.binding.utils.BindingUtils;

    Import mx.core.ButtonAsset;

    Import mx.core.mx_internal;

    Import MX.utils.object_proxy;

    public class CSExtensionTestJSX

    {

    public static function run():Sub

    {

    var myCSXS:CSXSInterface = CSXSInterface.getInstance ();

    var result: SyncRequestResult = CSXSInterface.instance.evalScript ('jsxFunction');

    btnPSCode.enabled = false;

    }

    }

    }

    ****************************************************************************************** *****************************************

    I get this error:

    image001.png

    I had initially written a panel using a Flex project and was able to access the properties of the items in the file main.mxml directly.  It seems that I can't do that.  Did I miss something in the code?  Am I missing some kind of library?  I'm sorry, I'm not very experienced in the development of Adobe, but we are trying to become more involved in the development of plugins and extensions for CS5.  Any help will be greatly appreciated.

    You must pass a reference to your object main mxml in the run method. For example:

    hand. MXML:


    http://www.Adobe.com/2006/mxml"layout ="absolute"historyManagementEnabled ="false">
       
           

    [Bindable]
    private var hostName:String = HostObject.mainExtension;
               
    ]]>
       
       
           
       

    testJSX.as:

    package
    {
    import com.adobe.csxs.core.CSXSInterface;
    import com.adobe.csxs.types.SyncRequestResult;
       
    Import mx.controls.Button;

    public class testJSX
    {
    public static void run(m:main):void
    {
    var result: SyncRequestResult = CSXSInterface.instance.evalScript ("jsxFunction");
    var b:Button = m.myButton;
    }
    }
    }

    HTH.

  • How to iterate through all the controls in a MXML component

    How can browse you a MXML component controls?

    What kind of objects you need for the loop foreach?

    for each {(var child: UIComponent in parent.children)

  • To access the Parent DataProvider ItemRenderer?

    It is possible to access the individual ItemRenderer is based on a data item for the Parent control?

    For example, I use control CheckBoxList of Alex Harui who uses his CheckBoxRenderer.  I want to be able to all the checkboxes to enable or disable.  I have added a new toggleAll function to CheckBoxList, which looks like this:

    
    public virtual function toggleAll(selected:Boolean):void
    {
         if (dataProvider == null)
              return;
         
         for each (var item:Object in dataProvider)
         {
              if (item == null)
                   continue;
             
              item.selected = selected;
         }
    
         invalidateProperties();
    }
    

    However, I think I really need to access the itemRenderer and set selected here instead.

    Try this post:

    http://blogs.Adobe.com/aharui/2010/01/checkboxes_in_datagrid_with_ch.html

  • Is that what I can pass the "Builder" parameters to the custom mxml component

    I would like to create a generic dialog box (popup) using mxml and then have my subclass of dialog boxes specific to application it.  I would spend at least a parameter to the instantiation, so there the reference to its parent window.  My code looks like this so far

    private static var DebugPopup:DebugViewer;

    public static void creationComplete(event:Event):void {}
    MainWindow = event.target as DisplayObject;
    DebugPopup = new DebugViewer (MainWindow);  //only works if no parameter passed
    }

    -DebugViewer.mxml looks like this - some code removed for reasons of brevity-

    < mx:TitleWindow >

    < mx:Script > <! [CDATA]
    Import mx.managers.PopUpManager;

    [Bindable] public var ParentWindow:DisplayObject;

    [Bindable] public var buffer: String = "Insert power ici\n;

    public void log(text:Object):void {buffer += text + "\n";}   }

    public void display ( parent: DisplayObject): void {}
    PopUpManager.addPopUp (this, parent);
    PopUpManager.centerPopUp (this);

    }
    []] > < / mx:Script >
    < mx:TextArea width = "400" height = "300" text = "{buffer}" / >

    < / mx:TitleWindow >

    I would like to set the parent window when I instantiate the dialog box, rather than go through the show method.  Is there a way to do this in a mxml component or I have to go to ActionScript.  I intend to make a general class of dialogue which is then subclssed by all of the specific dialogue of my application.

    You can do this:

    DebugPopup = new DebugViewer();
    DebugPopup.ParentWindow = MainWindow;
    
  • Help to create the MXML component

    I can't understand how to create a simple component in FB4:

    I create a folder in the src folder, called "components".

    I click with the right button on components and select new > MXML component

    In the resulting dialog box, in front of the light, when I pess the search button, all I get is a choice, "spark.components.Group.

    I don't know where to go from there.

    So how, exactly, I created a component based on, say, ComboBox?

    Just type "Combo" in the text field to the light and select ComboBox spark or MX ComboBox control from the drop-down.

    Peter

  • A custom, shipped event from custom mxml component isn't triggering the eventListener parent App

    I have a problem trying to fix now... Here's what happens:

    (1) I have a custom, event that is just CustomEvent.as that extends event.

    (2) when I close a TitleWindow, calling dispatchEvent (myEvent), where myEvent is an instance of the CustomEvent.

    (3) I checked the event get sent, because the Boolean that returns the dispatchEvent method is set to 'true '.

    (4) the eventListeners on the application parent never called.

    I use this process on another custom event and eventListener and it works.  It does not for this one.  Here is my code:

    / * The custom event class

    **/

    package me.events.Events

    {

    import flash.events.Event;


    /public class CustomEvent extends Event

    {

    Public static const WINDOW_CLOSED:String = "windowClosed";

    public void CustomEvent (type: String, bubbles: Boolean = true, cancelable: Boolean = false)

    {

    super (type, bubbles, cancelable);


    }

    }

    }


    / * The MXML component

    **/

    <? XML version = "1.0" encoding = "utf-8"? >

    " < = xmlns:mx mx:TitleWindow ' http://www.Adobe.com/2006/MXML "layout ="absolute"width ="400"height ="300"title ="replaced"showCloseButton ="true"borderStyle ="solid"cornerRadius ="0"creationComplete ="init (); "close ="windowCloser (); » >

    < mx:Label x = "10" y = "10" text = "" project name: "fontWeight ="bold"/ > "

    < mx:Label x = "10" y = "50" text = "' Description of the project:" fontWeight = "bold" / > "

    < mx:Script >

    <![ CDATA [ ]

    import me.events.CustomEvent;

    Public static const WINDOW_CLOSED:String = "windowClosed";

    public void init (): void {}

    private function windowCloser (): void { }

    var myEvent:CustomEvent = new CustomEvent();

    dispatchEvent (myEvent);

    PopUpManager.removePopUp (this);

    }

    ]]>

    < / mx:Script >

    < / mx:TitleWindow >


    / * The parent application

    **/

    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="absolute"creationPolicy ="all"creationComplete ="init (); » >


    < mx:Script >

    <![ CDATA [ ]


    private function init (): void { }

    this.addEventListener (CustomEvent.WINDOW_CLOSED, myHandler);

    intro = model.getIntro ();

    PopUpManager.addPopUp (intro, this, true);

    PopUpManager.centerPopUp (intro);

    }


    private void myHandler(e:CustomEvent):void { }


    //THIS IS NEVER CALLED!

    }


    ]]>

    < / mx:Script >


    < / mx:Application >


    If you display the TitleWindow as a popup, which is probably the problem, because the pop - up is not in the same display as the application list below systemManager. You may need to add the event listener to the systemManager.

    See my Flex 3 post recipe book where I use custom events and add event listeners to the systemManager:

    http://www.Adobe.com/cfusion/CommunityEngine/index.cfm?event=ShowDetails&ProductID=2&postI d = 11246

    If this post has answered your question or helped, please mark it as such.

  • Custom component AS3 / the event for MXML Tag definition


    Custom component AS3 / the event for MXML Tag definition
    Expose a custom in the custom MXML tag event.



    I made a custom AS3 component named "CustomListComponent".
    Is a list type component which extends UIComponent.

    When an element is selected (selected) I generate a custom event named, 'selChange '.

    I want the user to be able to use this tag, set a handler on the MXML tag.
    I tried to use metadata as [vent ("selChange")] in the file of AS3 components with no luck.

    Any help / examples to expose a custom event from a custom component AS3 for the MXML tag for the developer/end user would help considerably.

    Anyone? Thank you.

    To send the event in an AS3 component, try the following. The click event is simply to show you the idea. The event generated by the interaction of the user (or programming) could be anything.

    TS

Maybe you are looking for

  • DHCP service deactivation win.sbs 2003

    How can I close my Windows small bussiness server dhcp service 2003 without reactive when I restart the system?

  • change to XP

    I have a new computer with 7 Home Premium and to move to XP Pro.  I have XP PRO SP1 from my dead computer disk.  How can I do.  I was able to find information on adding 7 to XP Pro to dual boot, but can't reformat the hard disk, or remove 7.  Compute

  • Kangaroo Native

    Hi guys,. is their Menu Kangaroo all native (something like: http://iphoneincubator.com/blog/wp-content/uploads/2010/09/DontDisplayTwoPopoversOnTheiPad.png)? What I have to write my own only? Are all their instructions for user interface for this typ

  • Smartphones blackBerry tour update

    to connect a round of BB to the computer (which has been sync'ing with a curve via Blackberry Desktop Manager) transfer the contacts already "saved?" Thanks in advance! Marvin

  • Cannot display log with Palm E2 and Palm Desktop 4.1.4.

    I finally got the Palm Desktop 4.1.4, which works fine with Vista. I have a Palm Tungsten E2. When I sync, when he says that there were duplications, etc. and that I want to display the log HTM file, I click on view log and it appears impossible to v