How to instance an mx-component

Hi!
I have the following problem.
1. I got a mx:ViewStack (main) with two components: an mx:HBox and a custom made (app:NewMailBox).
2. In the main application I want to open the app:NewMailBox and initate it with a mail object
Probelm
The components in app:NewMailBox is null the first time I call method newMail.setMail() (please see code below). The next time i works.
Conslusion
It seems like the mx components must be shown to be created.
Question
How do I create the instances of a mx components in a viewstack without showing it first. Please see code below for some clarification ;-)
<mx:VBox>
    <mx:ViewStack id="mainStack">
          <mx:HBox>
              <mx:DataGrid id="mailGrid" dataProvider="{mailList}"
                         click="mainStack.selectedIndex = 1; newMail.setMail(mailGrid.selectedItem);">
                         //The newMail mx components are null the first time setMail() method is called and the newMailBox component is shown
                         //The second time this meethod is called all mx child components to newMailBox is created and it works perfectly
                  <mx:columns>
                          <mx:DataGridColumn dataField="@subject" headerText="Title"/>
                  </mx:columns>
              </mx:DataGrid>
          </mx:HBox>
          <app:NewMailBox id="newMail"/>
    <mx:ViewStack>
</mx:VBox>
Best regards,
Mattias

I've heard the Adobe team say creationPolicy="all" is to be avoided if possible.
You need to initialize all objects that you will reference before they are shown to some default valule, even if that value is meaningless, just so it is not null.

Similar Messages

  • How to load a customise component?

    I have created a customised component that i want to load
    dynamic.
    In the end i want to send a instance of the component i want
    to load to the user.mxml file.
    So i dont need to create a new (user) file when i create a
    new component.
    I want to use the same user file but with some different
    components.
    My code looks like this.
    ------UserForm.mxml ----------------
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="350" height="100%" >
    <mx:Label width="100%" id="headlabel" fontSize="20"
    textAlign="left" />
    <mx:Accordion width="100%" height="100%">
    <mx:Canvas label="Användare" width="100%"
    height="100%">
    <mx:Form id="userForm"></mx:Form>
    </mx:Canvas>
    <mx:Canvas label="Företag" width="100%"
    height="100%"> </mx:Canvas>
    </mx:Accordion>
    </mx:VBox>
    ------ User.mxml -----------------
    <mx:Script><![CDATA[
    public function init(url:String):void {
    getURL += url;
    var tmp:UserForm = new UserForm();
    edit.addChild(tmp);
    ]]></mx:Script>
    <mx:VBox id="edit" width="100%" height="100%">
    <mx:HBox>
    <mx:Button id="save" label="Save" bottom="10" right="10"
    click="saveRow()"/>
    </mx:HBox>
    </mx:VBox>
    The problem is that i can't se the UserForm.
    How can i do?

    The problem is the height="100%" in the UserForm.mxml. That
    value is not going to be honored when you create the component
    dynamically. You could try this:
    var tmp:UserForm = new UserForm();
    tmp.percentHeight = 100;
    edit.addChild(tmp);
    The other option is to explicity set the component's height:
    tmp.height = edit.height; // since you want 100%
    edit.addChild(tmp);
    It's a little quirk of the Flex Framework.

  • How to Install SSIS COM Component on Client side

    Hi,
    I am new to BPC.
    I can't install SSIS COM Component on Client side.
    and i guess,  it lead BPC Excel , Data Manager is not working.
    Because all the user are local user on server side, no domain
    I have run OSoftSetup.exe,  but the result is
    Error (Login failed for user ". The user is not associated with a trusted SQL Server connection.)
    i have tried to change the OutlookSoft.config in OSoftSSIS_Client\Bin Folder
    and the config doesn't take any effect.
    How to How to Install SSIS COM Component on Client side?
    thx
    It is client side PC_MS\Logging\Log
    #ERROR#CustomXMLClt##EPM-BPC-MS##e17c2022-c7d4-4a0b-8515-b719441e3dbf###XMLParser : GetTagValue#hostname
    user########Plain##[LOG ID:22]System.NullReferenceException: Object reference not set to an instance of an object.
       at OSoft.Consumers.Common.CustomXML50.XMLParser.GetAttributeValue(String strKeyValue, String strAttKeyValue, String strSubKeyValue)#
    thx
    John

    But the problem is...in client side
    When opening Office 2007 Excel -> eTool -> Data Manager
    There have no option showed.
    and in C:\Documents and Settings\<user>\My Documents\PC_MS\Logging\Log
    it has following error.
    2010 08 21 17:15:35:875#+8:00#ERROR#CustomXMLClt##EPM-BPC-MS##51cea66a-13cd-49fc-afdd-7b492566bd12###XMLParser : GetTagValue#<HOSTNAME>
    BPCADM########Plain##[LOG ID:346]System.NullReferenceException: Object reference not set to an instance of an object.
       at OSoft.Consumers.Common.CustomXML50.XMLParser.GetAttributeValue(String strKeyValue, String strAttKeyValue, String strSubKeyValue)#
    2010 08 21 17:15:35:875#+8:00#ERROR#DMClientTools##EPM-BPC-MS##7aec1fbe-5fda-4c91-9c4a-1eec5e59911b###DMTools::ErrCheck#<HOSTNAME>
    BPCADM########Plain##[LOG ID:347]System.Exception: 91: Object reference not set to an instance of an object.
       at OSoft.Consumers.DataMgr.DMClientTools50.DMTools.ErrCheck(String strRtn)#
    2010 08 21 17:15:35:875#+8:00#ERROR#DMClientTools##EPM-BPC-MS##48f5a612-a046-4ef9-a56c-db565ef489d2###DMTools::GetServerInfo#<HOSTNAME>
    BPCADM########Plain##[LOG ID:348]System.Exception: 91: Object reference not set to an instance of an object.
       at OSoft.Consumers.DataMgr.DMClientTools50.DMTools.ErrCheck(String strRtn)
       at OSoft.Consumers.DataMgr.DMClientTools50.DMTools.GetServerInfo(String strContext, String strFilter, String strSecurity)#
    2010 08 21 17:15:35:890#+8:00#ERROR#DMConsole##EPM-BPC-MS##af7f7343-1cb2-4802-a667-2adbb1b8e2fd###basClientTools::ChangeClientSiteList#<HOSTNAME>
    BPCADM########Plain##[LOG ID:349]Subscript out of range#

  • Changing look and feel for one INSTANCE of a component

    I am trying to change the look and feel of just ONE instance of a component. In particular, I want to change the color of the JScrollBar thumb on a certain JScrollPane. I want this change to not affect any other component, either before or after. How can I do this?? Any help would be much appreciated.
    AC

    Hi acalvin3!
    I have a solution. Use the UIManagers database. You should overwrite the default settings for the resource you want to change, the code is self explaining:
          UIManager.put( "Button.margin", commonMargin );
          UIManager.put( "Button.focusInputMap", commonInputMap );
          UIManager.put( "Button.font", buttonFont );To reset values you only have to use
          UIManager.put( "Button.margin", null );
          UIManager.put( "Button.focusInputMap", null );
          UIManager.put( "Button.font", null );Set values before you create your component and reset values immedeately after you created your component, otherwise you may affect other components too.
    With following code you can find out default values for the whole UIManagers database:
          Hashtable defaultProps = UIManager.getDefaults();
          Enumeration enum = defaultProps.keys();
          while (enum.hasMoreElements()) {
             Object key = enum.nextElement();
             System.out.println( "key: '" + key + "'\t value: '" + defaultProps.get(key) + "'" );
          }You just have to look for the output for the component you want to change the look and feel.
    Have fun...

  • Multiple component instances for one component usage

    Hi,all
    How can I create multiple component instances for one component usage.
    I'm using the following code for creating  a single component instance for specific component usage:
    if(c_Usage.hasActiveComponent())
          c_Usage.deleteComponent();
    if(wdContext.currentContextElement().getSelectedTab().equalsIgnoreCase("Registered"))
          c_Usage.createComponent("health.gov.registered.Registered";);
    I can't create one more component instance for
    IWDComponentUsage c_Usage
    cause I have to delete the component instance associated with this component usage.
    Any idea how can I do it anyway?
    Regards,
    Michael

    Hi,
    To create another instance of the same component you need to embed the same component under the Used Components more then once. For Example if you have Componet A to which you want to embed Component B then under "Used Components" of Component A add component B twice.

  • How to create a view(Component Tree)?

    After I look at the source codes of the RestoreViewPhase.java and ViewHandler,I find that "createView" only to get an instance of the UIViewRoot class,and not add any children at all.So I want to know how JSF can get the component Tree from the "createView" method?

    In fact if the first time a page is accessed, the component tree is only complete AFTER the render response. I must agree that this is lousy. In fact Smile supports a non-JSP model where the component tree is constructed at createView() time. Which allows you to do some initialisation for your new page/screen.
    In the JSP model you have to go through managed beans or setup context upfront, which you don't want because you want the init code for a screen be coded together with that screen.
    In fact I'm still looking for a way to stick with the spirit of the specs, but have a common way to have some 'event handler' that allows you to setup some context when a new screen is accessed.
    Dimitry D'hondt. (http://smile.sourceforge.net)

  • Multiple instances of same component become non-editable

    I have created a simple component for authors to add links. They enter anchor text, link destination, title attribute, via textfield. They set the target attribute via a dropdown list, xtype=selection. The issue we run into, is that if the author has entered multiple instances of the same component on a page, the dropdowns become non-editable after they are set the first time. They cannot be edited changed until the page edit view/content finder is closed and reopened.
    Scenario:
    1. User drag/drops component
    2. User makes selection from dropdown xtype=selection
    3. User drag/drops same component again to allowed parent
    4. User make selection from dropdown xtype=selection in second instance of component
    5. User can no longer change the selection in either instance of the component without closing and reopening edit view/content finder.
    6. User closes and reopens edit view/content finder.
    7. Again, both instances of the dropdown xtype=selection become non-editable after first selection of an option until the edit view/content finder is closed and reopened.
    When there is only one instance of the component on the page, the drop downs/xtype=select remain editable at all times.
    In addition to this particular scenario, I've had to work around some other issues of multiple instances of a component, where only one instance on a page works at all, the data gets crossed/jumbled between instances of the same component, etc.
    My question is first, how might I solve for the scenario fully called out in this question? Secondly, is there some methodology to making multiple instances of the same component track themselves individually, work together on the same page, play nicely with each other?
    Any assistance is appreciated.

    Using request scope would be a workaround.
    I'm looking for view distinct state for the associated component tree for the session (i.e. managed bean state, whether its separate instances of the bean or copies of serialized state I don't care)
    My views require conversational-like state handling that I don't want stored on the client.

  • How to populate the time component of a cube?

    We have a question regarding how to populate the time component of a cube. Let me explain:
    We are using OWB 10gR2. We have created a cube with several dimensions. We are now building the mapping to load the cube. The cube operator has two columns for every dimension (e.g., "customer" and "customer_id" for the "customer" dimension).
    We understand that, in this case, "customer_id" stands for the dimension business key, so we create an arrow from the business key in the source table to the "customer_id" column in the cube operator.
    So far so good. The mapping works all right, and the cube is loaded correctly.
    Now we need to do the same for the time dimension. We have already created the time dimension and we have loaded it. We have also included it in the cube, so now we have two new columns in it: "time_day_code" and "time", both NUMBER data type.
    We have the "sale_date" column (DATE data type), in the source system and, of course, now we want to populate the date column in the cube. We suppose that, somehow, we have to translate the "sale_date" field into the numeric column of the surrogate key of the time dimension. How should do we do this? I suppose that OWB must do the translation for us, just as it does for the other dimensions, but how? We have been looking into the manuals, and we have found no explanation on how to go about this.
    Any help would be appreciated.
    Best regards
    Juan Algaba

    Hi Juan
    You are right this should have been in the manuals, checked and there is only a brief mention (Using a Time Dimension in a Cube Mapping section)
    The identifier format should have been documented for each level and will involve creating the formatted attribute for input to the cube operator's time dimension reference attribute.
    The time dimension business keys are stored as follows;
    Day Level - YYYYMMDD
    Month Level - YYYYMM
    Week Level - YYYYWW
    Quarter - YYYYQ
    Year - YYYY
    If you have a source that has a SQL date datatype for example and want to construct the key for a cube's time dimension at the day level something like the following expression can be used to construct the time reference from a SQL date...
    to_number(to_char( time_key, 'YYYYMMDD'))
    The result of this expression can be used as input to the cube's time dimension attribute.
    Cheers
    David

  • How can I use EJB component on Weblogic 8.1 server ?

    hi,dear sir:
    How can I use EJB component on Weblogic 8.1 server ?
    It need client jar to invoke ejb,but what will I to do for this jar file? what does it contain? format ?
    If my EJB module contain 100 session bean and 50 Entity bean,but I want invoke 20 session beans in my module, how can I to do?
    thank you...

    Hi,
    This forum is exclusively for Creator. please post this on appropriate forum
    regards
    CreatorTeam

  • How to Create a Table Component Dynamically based on the Need

    Hello all,
    I have a problem i need to create dynamically tables based on the no of records in the database. How can i create the table object using java code.
    Please help.

    Winston's blog will probably be helpful:
    How to create a table component dynamically:
    http://blogs.sun.com/roller/page/winston?entry=creating_dynamic_table
    Adding components to a dynamically created table
    http://blogs.sun.com/roller/page/winston?entry=dynamic_button_table
    Lark
    Creator Team

  • How many Instances can I install on one machine?

    Hi Folks,
    Do you know how many oracle instances I can install on my Win OS machine.
    I already have three different instances. Typically how many instances Oracle recommends to setup in one machine to ensure performance improvement?
    I use Oracle 9 and oracle10g both. In fact, Oracle9 in Solaris and oracle10g on win.
    Regards,
    Amir

    In general, it recommends one instance per server
    in a production environment, for a variety of
    reasons (maintainability, backup/recovery, easier to
    tune, better use of resources).If you have 100 productives databases, it is very probable that you won't be able to have one server per database.
    Again, it depends on your number of users, processors and ram... But if you 16G ram and 16 processors, you should well be able to able to have 20 databases with not too much activity.
    The number of 20 here means truely nothing. I admit. But recommending one instance per server is not ok.
    Many applications require to have a separate database. It is the double administration necessary, but it is better than the troubles generated when 2 software vendors are sharing the same db.
    For development, I have some systems with over 50 instances running with 16g ram and 8 cpus.

  • EastWest Symphonic, LA Scoring Strings - How many instances can you run?

    Hi - After investing in a new quod core recently and been really depressed by the performance I'm getting I wondered whether users of EW Symphonic Orchestra and/or LA Scoring Strings, Vienna Symphonic etc... could share with me how many instances they can load and run in a mix.

    Hi,
    i understand your frustration
    Below is a list of the things I had do to to make my system usable:
    1. Turn Airport & BlueTooth : OFF
    2. Apple System Preferences:
    Energy Saver: Set Computer and Hard Drive to: Never Sleep,
    Software Updates: Check for update: Uncheck
    3. Logic Preferences, Audio , Devices:
    I/O Buffer Size 512
    Software Monitoring: OFF
    Process Buffer Range: Large
    Audio Units Manager: Uncheck all AU plugins not being used!
    4. Logic Preferences, Audio, General:
    Track Mute/solo: CPU-saving(Slow Response)
    Sample Accurate Automation : OFF
    Plug-In Delay Compensation: OFF
    5. Assign ALL tracks thru Buss's, See Link below
    http://support.apple.com/kb/HT3161
    6. Keep a muted audio track in the arrange page and have it selected
    LOgic uses additional CPU power if a midi track is selected
    7. Keep at least 50gb or more of free space on the hard drive
    8. Run the freeware program Mac Janitor
    9. Do not run any other programs during the Logic Session. Close all programs not being used.
    10. VERY IMPORTANT! Restart computer to flush ram. Do this each and every time you reload your Logic Sequence.
    Also check out this link:
    http://www.youtube.com/user/SFLogicNinja#p/a
    I hope this helps

  • How can I get the component LTC1060 in the multisim 10 library ?

    How can I get the component LTC1060 in the multisim 10 library ?

    ahnsei ,
    This is a switched capacitor filter - with a variety of configurations for each mode of operation based on the switching frequency.   To create a transistor level SPICE model would be unrealistic (which is probably why you haven't found one), so I would suggest looking at the datasheet and specifically, looking at each mode of operation and seeing if you can approximate the filter topology with an expression for the transfer function given in the datasheet (by calcuting based on the switching frequency).
    Based on the expression you get, you can use the Multisim component "TRANSFER_FUNCTION_BLOCK" to plug in the correct transfer function and thus approximate the behavior of the filter in the circuit.
    This transfer function can be found in the Master database -> Sources -> CONTROL_FUNCTION_BLOCKS.   There was a previous discussion giving some additional details on how to setup the transfer function block:
    http://forums.ni.com/ni/board/message?board.id=370&thread.id=3987
    Regards,
    Patrick Noonan
    Business Development Manager
    National Instruments - Electronics Workbench Group
    50 Market St. 1-A
    S. Portland, ME 04106
    Email: [email protected]
    Tel. (207) 892-9130
    Fax. (207) 892-9508 

  • How to set a Swing component as Modal window on a SWT Component.?

    How to set a Swing component as Modal on a SWT Component.I mean, I have a window (SWT Container) with some menu items.
    When I click on one menu item then i will get one new Swing Window.
    When creating the new frame I had passed Modal value as TRUE in the constructer.Now child is not behaving as Modal Window.I mean I am able to go to parent window even though the child window is opened as a Modal Window.This is only happened when I double click on the Title Bar of the Parent Window.
    If I try to click on any other part of the Parent Window except Title bar ... the child window is working as a Modal Window.
    Can any one suggest me to solve this one !!

    int this case, do this :
    JFrame f = new JFrame("Authentification");
    f.getContentPane().setLayout(new BorderLayout());
    f.getContentPane().add(myJPanel, BorderLayout.CENTER);
    f.setBounds(x,y,w,h);
    f.setVisible(true);
    Where myJPanel is the Panel you developped.

  • How to set a Swing component as Modal on a SWT Component?

    How to set a Swing component as Modal on a SWT Componen?.I mean, I have a SWt Component window and from that window I am displaying a SWING Component Modal window.
    The problem is my swing window is not working as Modal always.
    When I opened the swing window from SWT window,swing window is working as Modal.But if Idouble click on Menubar or Title bar of the SWT Window then my Swing window goes back.If I click on any other part of the SWT window.. then once again Swing window is working as modal.
    Can any one suggest me to solve this?
    I think this is isuue related with Swing over SWT..

    pradeep.rajadurai wrote:
    I want set the JTable as a background of jframe or jinternalframe , how it is possible One way that may work, you can always extract the image from a rendered JTable and then paint the same image into the JPanel that holds your components via it's paintComponent method, then added the JPanel to the app's contentPane.
    give me simple pgmIs English your second language? Because if so, please understand that this demand can be taken by some as rude.

Maybe you are looking for

  • ADMIN CAN'T UNLOCK SYSTEM PREFS!!! THIS IS A BUG, PEOPLE!

    Ever since I upgraded to Maverick, I haven't been able to change my locked system preferences. They just won't unlock, no matter what I do. Everywhere I've gone to get some clarity on this problem, all anybody asks is if I'm the Admin, like I'm some

  • Ive updated my iphone 4 it says to connect to itunes, then syncs then othing

    i updated my iphone to what was suggested, connected it to itunes to sync it then nothing, says its done but no access to phone

  • Dreamwaever/CF Form Display Issue

    This is a comnination Dreamweaver/Coldfusion question.  I'll post to both forums. I just noticed that when I use <CFFORM>...</CFFORM> tags in Dreamweaver, Dreamweaver shows the form (in display mode) with an extra whitespace above the form. It doesn'

  • Media Error when fast forwarding downloaded videos from Video Store

    I can't fast forward videos I have purchased and downloaded from the Video Store.  I get the error message "Media error please try again." When I click OK the video closes. This is very frustrating since the video player does not recognize and rememb

  • Side by Side function in iMovie 11

       Have an issue with Side By Side function. Maybe this has been addressed before, But I want to do a Side by Side effect and use any kind of Transition before or after it. In this case just a simple fade to and from  black.    The issue is this: Aft