How to access the component id from another mxml?

I tried to set the data to a DataGrid in another mxml, but the complier said there's 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 compiling error is :
Multiple markers at this line:
-1120: Access of undefined property dgFile.
-arrFile
Anybody can tell me, how to achieve it?
Thanks a lot!

Hi, You cant access it like this. To access, first give some id to the custom component you have added.
i.e
<custom:FileDataGrid id="custFDG"/>
Then you can acces it from script,
custFDG.dgFile.dataProvider = arrFile;
Hope this shud work fine.
Thanks.
Abhinav

Similar Messages

  • OOABAP-How to access the protected methos from a class

    How to access the protected methos from a class..There is a built in class..For tht class i have created a object..
    Built in class name : CL_GUI_TEXTEDIT
    method : LIMIT_TEXT.
    How to access this..help me with code

    hi,
    If inheritance is used properly, it provides a significantly better structure, as common components only
    need to be stored once centrally (in the superclass) and are then automatically available to subclasses.
    Subclasses also profit immediately from changes (although the changes can also render them invalid!).
    Inheritance provides very strong links between the superclass and the subclass. The subclass must
    possess detailed knowledge of the implementation of the superclass, particularly for redefinition, but also in
    order to use inherited components.
    Even if, technically, the superclass does not know its subclasses, the
    subclass often makes additional requirements of the superclass, for example, because a subclass needs
    certain protected components or because implementation details in the superclass need to be changed in
    the subclass in order to redefine methods.
    The basic reason is that the developer of a (super)class cannot
    normally predict all the requirements that subclasses will later need to make of the superclass.
    Inheritance provides an extension of the visibility concept: there are protected components. The visibility of
    these components lies between that of the public components (visible to all users, all subclasses, and the class itself), and private (visible only to the class itself). Protected components are visible to and can be used by all subclasses and the class itself.
    Subclasses cannot access the private components  particularly attributes) of the superclass. Private
    components are genuinely private. This is particularly important if a (super)class needs to make local
    enhancements to handle errors: it can use private components to do this without knowing or invalidating
    subclasses.
    Create your class inse24 and inherit this CL_GUI_TEXTEDIT
    class in yours. You can then access the protected methods.
    Hope this is helpful, <REMOVED BY MODERATOR>
    Edited by: Runal Singh on Feb 8, 2008 1:08 PM
    Edited by: Alvaro Tejada Galindo on Feb 19, 2008 2:19 PM

  • How to access the abap program from MS Excel?

    Hi ,
    How to access the abap program from MS Excel or MS access ?
    The abap program "z..."  has the below input and output attributes
    Input : Date,Index and file name with location (.htm or .xls)
    Output : htm or xls file downloaded at the above location.
    Please help me here.Do we haev to use BAPI and RFC?If yes,please tell me how to use them
    Regards
    Dinesh

    Maybe this could help you up -;)
    [Simple SE38 Emulator using Microsoft Excel|Simple SE38 Emulator using Microsoft Excel]
    Greetings,
    Blag.

  • Problem in accessing the media files from another server

    Currently I am working in a project with streaming video on demand and using FMS 4.5.
    Let’s say the FMS is installed on one machine say ‘121.123.35.34’ and there is another server ‘100.54.88.222’ where all the media files belong. Now we need to point to this third server to play videos from FMS.I have done the below changes:
    In the fms.ini file: set the VOD_DIR2 = \\100.54.88.222\myvideos
    In the application.xml: Added the stream: <Streams>/hr;${VOD_DIR2}</Streams>
    From my application accessing the path of flv as:source= “rtmp:// 121.123.35.34:1935/vod/hr/test” . Not able to access the video.
    Note: If I will point to say ‘C:hrvideos’ in VOD_DIR2, then I am able to access the videos using the same URL.
    I also tried mapping the shared path to the FMS machine and then given the mapped drive path in the VOD_DIR2, but this also doesn’t work.
    Please let me know:
    If we need to configure any other parameter to stream videos from another server.
    VOD_COMMON_DIR: I modified this similar TO VOD_DIR to location 'C:hrvideos', I am able to stream the videos using rtmp, but not abl eto stream with http.
              Please let me know  can we stream using http also as we need this to run f4m manifest file.
              http://121.123.35.34:8134/vod/hr/sample.mp4.
              http://121.123.35.34:8134/vod/hr/sample.f4m
    Thanks,
    Anjali

    Hi Shiven,
    I followed the steps suggested by you:
    1) Changed the stream:
    <Streams>/hr;${VOD_DIR2}</Streams> to<Streams>/;${VOD_DIR2}</Streams>
    But not able to access the video with rtmp:// 121.123.35.34:1935/vod/test
    2) For http streaming, changes the HttpStreamingContentPath in hds-vod in the httpd config file, and tried to stream the video like:
    http:// 121.123.35.34:8134/vod/test.mp4 or
    http:// 121.123.35.34:8134/hds-vod/test.mp4
    But not able to load the video.
    Please suggest?
    Thanks & Regards,
    Anjali Rawat

  • How to access MainPage.xaml controls from another page

    i have an image element in the MainPage.xaml and a flyout in SettingsContract1.xaml, when the flyout item is clicked the filepicker is
    opened and i want to set them image source of the image in the Mainpage with the file picked from the filepicker. How can i access the image from SettingsContract1.xaml
    image in MainPage.xaml
    <Image x:Name="img" HorizontalAlignment="Left" Height="332" VerticalAlignment="Top" Width="778" Margin="349,406,0,0"/>
    menuflyout sub in SettingsContract1.xaml.vb
    Private Sub chooseFile_Click(sender As Object, e As RoutedEventArgs) Handles chooseFile.Click
    Dim filePicker As FileOpenPicker
    filePicker = New FileOpenPicker()
    filePicker.ViewMode = PickerViewMode.Thumbnail
    filePicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary
    filePicker.FileTypeFilter.Add(".png")
    Dim file As StorageFile = Await filePicker.PickSingleFileAsync()
    Using filestream As Streams.IRandomAccessStream = Await file.OpenAsync(FileAccessMode.Read)
    Dim bitmapImage As Windows.UI.Xaml.Media.Imaging.BitmapImage = New BitmapImage
    bitmapImage.SetSource(filestream)
    img.Source = bitmapImage 'gives an error
    End Using
    End Sub

    Found the answer from stackoverflow
    Private Async Sub chooseFile_Click(sender As Object, e As RoutedEventArgs) Handles chooseFile.Click
    Dim mapImage As Frame = Window.Current.Content
    Dim mainPage As MainPage = mapImage.Content
    Dim filePicker As FileOpenPicker
    filePicker = New FileOpenPicker()
    filePicker.ViewMode = PickerViewMode.Thumbnail
    filePicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary
    filePicker.FileTypeFilter.Add(".png")
    Dim file As StorageFile = Await filePicker.PickSingleFileAsync()
    Using filestream As Streams.IRandomAccessStream = Await file.OpenAsync(FileAccessMode.Read)
    Dim bitmapImage As Windows.UI.Xaml.Media.Imaging.BitmapImage = New BitmapImage
    bitmapImage.SetSource(filestream)
    mainPage.img.Source = bitmapImage
    End Using
    End Sub

  • How to access the MDX application from SQL server when working with OBIEE?

    Hi,
    I am new to MS SQL Server 2005. We have developed the OLAP Cubes on SQL Server Business Intelligence Development Studio with its integration with Oracle Business Intelligence Enterprise Edition (OBIEE).
    The backend query is in MDX language. Now if I need to run that query I need to access the MDX Application, rite?
    So need to know how to connect to MDX application.
    Regards,

    Administration Tool: File - Import - "from multidimensional". There you choose "Provider Type" = "Analysis Server 2005". You specify the URL, user name and password. Then you can import MSAS cubes just like Essbase ones.
    Cheers

  • How to access the MDX application from SQL server?

    Hi,
    I am new to MS SQL Server 2005. We have developed the OLAP Cubes on SQL Server Business Intelligence Development Studio with its integration with Oracle Business Intelligence Enterprise Edition (OBIEE).
    The backend query is in MDX language. Now if I need to run that query I need to access the MDX Application, rite?
    So need to know how to connect to MDX application.
    Regards,

    I think that you have posted this query to the wrong forum. Try this one:
    Business Intelligence Suite Enterprise Edition
    --Andy                                                                                                                                                                                                                                                                                           

  • How to summon the Dock correctly from another display

    Whenever I try to summon the Dock from another display it won't switch displays. It's stuck, I do several passes with the cursor trying to call it but sometimes it works, sometimes it doesn't. I leave the cursor moving it on the border of the screen and even click it nothing.
    I noticed that if I click a window on the screen where I want to summon it to, it speeds the process, but it won't always work.
    Since I've been running Mavericks since it was in beta, I figured there was something wrong with some file so I did a clean install from the official Mac App Store copy and didn't do a Time Machine restore. Still nothing.
    It's the Dock supposed to behave this way? It's this delay normal or is Mavericks still not finished? I don't have AppleCare support anymore so I can't call and rant/ask4assistance on the phone.
    Help.

    Hi Ingo,
    check the existing process types. You can see their coding by copying the class name from the process chain maintenance --> Settings --> Maintain Process types.
      Cheers
        SAP NetWeaver BI Organisation

  • How to run the java program from another directory?

    Hi
    Assumption:
    data.java is in a package suncertify.db and place in a directory c:/code/suncertify/db/ directory
    data.class file: is in c:/code/suncertify/db/ directory
    current directory: c:/
    How can execute the data.class directly in c:/ directory without changing directory to c:/code/ ?
    Thanks in advance,
    Adrian

    Yes. You can use the -classpath and -sourcepath options to specify where to look for source files, and the -d option to specify where to generate the class files. Look up the usage of those options in the javac documentation:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javac.html

  • How do I share the Photo Library on my desktop with another User. I have Apoerture set up on my wife's user account but cannot figure out how to access the photo library from her desktop.

    I just got a new IMac. I transferred all the photos from our old PC to the Aperture Library on my User account. My wife is set up as another User. She can access Aperture from her User account but there are no photos in the Library. How can I share or giver her access to the photos so that she can work with them on Aperture from her User account?

    Move the Aperture library to separate disk or disk partition with plenty of space for all your photos. On a separate disk or partition it will be possible to set the "Ignore ownership on this volume" flag. Then two users can write to the same Aperture library without permission problems.
    The procedure is describe here for iPhoto libraries, but this will work for Aperture libraries as well:
    iPhoto: Sharing libraries among multiple users
    If you want to use a drive for your Aperture library, that has been used with a PC, format it for Mac, before you move the Aperture library there. This can be done with Disk Utility.

  • How to access the database tables from application

    Hii all,
    The information in webcenter content, such as meta data fields, users, security groups etc are stored in
    database tables like-      Revisions, SecurityGroups, Users, DocType etc..
    Can we access this tables from an adf application or any webcenter application..
    If yes, then what can be the approach for that..??
    Another things, how can we create custom tables just like the predefined tables...??
    Any information regarding this.??
    Thanks

    Can we access this tables from an adf application or any webcenter application.Yes, you can - like to any other existing database. But I would strongly discourage you from any, but read-only access, or you can easily end up with inconsistent data.
    If yes, then what can be the approach for that..??Just create a database connection and define in your model what tables you want to access.
    Another things, how can we create custom tables just like the predefined tables...
    Actually, WebCenter Content provides functionality of creation of custom tables (see http://docs.oracle.com/cd/E23943_01/doc.1111/e10978/c04_metadata.htm#autoId2 ) and these are probably the only good candidates for read-write access. See further in the manual what use cases are supported. Of course, you could do this even externally, but rather than Data Definition Language, I'd use services (if there are some).

  • How to access my website created from another computer and location?

    I am a beginner.  My nephew made an e-commerce site for me using dreamweaver on a Mac.  I purchased dreamweaver cs5 and have windows vista.  He sent me the FTP address, username and password.  I opened dreamweaver and am asking what to do to access and download the files?

    but it keeps saying that the local files should match exactly to the web which I obviously don't have.
    What's the exact message?
    The whole purpose of connecting is to download remote files to local so they mirror each other.
    It describes how to up load but not download.
    Download is the exact opposite of upload.
    Select Remote View, select all files, click Get.
    When I get to that point, that will download all the webfiles into my local folder rewriting everything there?
    Yes.
    But you don't have any files locally which will be overwirtten, do you? Just an empty folder waiting to be filled with files from the Remote server.

  • [Solved] How to recover the package list from another installation?

    Hello,
    I supposed gparted could make a fine result by moving the partition, but it didn't.
    I was doing that on an USB installation, now fsck recover partially my partition, but mostly many files are gone. It seems that pacman databases are saved, then I would like to recover the list and try to reinstall all packages.
    I can't enter by chroot on that partition, bash fails.
    My attempt is to use pacman -r /mounted/partition packagelist, if I'll get the list, then it mostly possible to regain chroot access
    EDIT
    I got a flashback and I applied modifications in a temporary pacman.conf. In that configuration I modified the paths to all file used by pacman to reflect the other installation.
    Finally I could get the list, but I didn't go for an update, because the installation was too old. I'm doing a fresh install with the recovered package list.
    Last edited by TheSaint (2013-08-02 09:39:59)

    I'm entirely agreed with you.
    Some time I fail to remember such things. I don't regret much the loss, it was just a support installation for emergency cases. Home is safe in another partition
    However it is a good exercise to rescue the package list.

  • How to access Shared Component Images from External Javacript File

    Hi,
    I have an external javascript file that is referenced within a page that consists of a number of calls to images within the Shared Components, i.e.:
    "#WORKSPACE_IMAGES#up_arrow.png"
    Unfortunately this no longer seems to work when used in an external js file.
    What options do I have to allow the external js to access images within the Shared Components/database?
    Thanks.
    Tony.

    Hi,
    You do not have much options, that is know limitation.
    This post is about same kind problem with CSS files
    Re: referencing workspace image in CSS file
    Br,Jari

  • How to access the stored procedures from Java

    Hi,
    There is stored procedure in oracle sql and that have two input parameters and recordset as an output parameter.
    eg.
    CREATE OR REPLACE PROCEDURE Test(
    p_Age JUNK.Age%Type,
    p_SURNAME JUNK.SURNAME%TYPE,
    RC1 IN OUT P_GETALLTOPICDATAPkg.RCT1)
    Now i want to execute this by using Java JDBC.I have wrote the following code,
    but how to convert "String data to Clob data".
    Code is :
    String strSPName = "{ call Test(?,?,?) }"; oracle.jdbc.driver.OracleCallableStatement cstmt = (oracle.jdbc.driver.OracleCallableStatement)MyConn.prepareCall(strSPName);
    cstmt.setInt(1, 001);
    String ClobData ="AMMA AAI MA";
    cstmt.setClob(2, (java.sql.Clob)ClobData); above gives error*/
    cstmt.execute();
    Can any body help.
    null

    Try using setCharacterStream (this should work in 816 I am not sure of prior Oracle/JDBC releases)
    String ClobData ="AMMA AAI MA";
    java.io.StringReader sr = java.io.StringReader(ClobData);
    cstmt.setCharacterStream(2,sr,ClobData.length());
    cstmt.execute();
    Good luck

Maybe you are looking for