Using string to create object reference?

How do I use a string to dynamically set an object reference?
For example, I have a pop up window with a function to set
the text of a text object in the main application:
Application.application.t1.text = completeString;
The "t1" is the object, of course. There are several such
objects, t2, t3, etc. I'd like to make this a variable item in the
popup, and pass the reference to WHICH text object (eg, "t1' or
"t2") from the popup's parent.
So, if the variable was something like "whichBox" (not sure
what to type it as), then I'm looking for something like:
Application.application.
whichBox.text = completeString;
Which I cannot get to work... what am I missing here?

perhaps you can try this...
Application.application[myParam].text
where myParam is a String var with the value of 'whichBox' or
whatever name you wanted.

Similar Messages

  • Create Object References for Key field

    Hi Experts,
    Question 1- Do we have any standard task that create BOR object reference using key field?
    Question 2 - If not, i have created a task with key field as import parameter and BOR type as return object reference. No i am just using macro "SWC_CREATE_OBJECT OBJREF_ARD 'AssetRequestDocument'  ASSETREQUESTID." where ASSETREQUESTID is key field. OBJREF_ARD is object ref type.
    Problem comes here - Its not getting instantiated, i debugged an saw it checks for logical system in the FM OWN_LOGICAL_SYSTEM_GET, i guess since SWO_CREATE is remote enabled FM it is checking for OWN_LOGICAL_SYSTEM_GET function. In our system for the client there is no logical system defined and i dont have any idea how to customize table T000 for logical system.
    Note - There is nothing related to communication between two system.
    Can anyone help me out?
    Thanks in Advance,
    Pritam Kunal

    Hello,
    It's a method. You make a task which calls that method and passes in the BOR type and its key.
    It instantiates an instance of the BOR and passes it back out.
    So, no, it's not a generic BOR!
    regards
    Rick Bakker
    Hanabi Technology

  • Create object reference by name

    I wish to disable and enable a bunch of controls on the front panel. Instead of creating hard-wired property nodes, I wish to cycle through an array of string names of controls and set the corresponding control's property. Is it possible to create a reference on the fly based on a string? The reference will then be fed to a Property node. Or is there an alternative way for my problem?

    See the image below for a better example.
    This one provides a list of all the controls on the front panel.  See the names of the labels appears in the ArrayofCtrls.
    RayR
    You can create a subvi of this. Replace ThisVI by a control.  You then wire This VI from the calling VI.  Or, you can get fancy and wire a pathname to the appropriate function which replaces ThisVI in the above example.  You can then obtain front panel listings for other VI's.  The possibilities are alomost endless  
    Message Edited by JoeLabView on 01-08-2008 08:11 AM
    Attachments:
    _example.PNG ‏33 KB

  • How to use String to name objects

    Hello,
    I have an array of 100 Strings and I want to create 100 objects of a Class with same names as the ones in the Strings, is there any way to do it?
    I have searched the forum and I think it can be done with a Map Class, but I wonder if there is a more convenient way.
    Thanks,
    Kostas

    Any way other than actually putting them into the map? What did you have in mind? Some kind of zen map, perhaps? :-)
    This is exactly the sort of thing a map is for - mapping instances of one class to instances of another; in this case mapping strings to Resources. So this is almost certainly the best data structure.
    How you obtain the names and the Resources is another matter. Taking them in as separate arrays (which might have different lengths) may not be the best solution. A better solution might be to make the Resources able to identify themselves so you could add them to the Map and ask them for their names to use as the keys.
    Also, I notice that you're creating an array of these resources, but the array will be initialised with 100 (actually, 101 - 0..100) null pointers. This is probably not what you want. And even correctly initialising the array with Resources constructed through the default constructor might not be what you want. You could, maybe, wrap your map with another class which queries the map and lazily creates Resources for you if they don't already exist.

  • Use Granfeldts Create Object to create dynamic groups

    Trying to use Sorens Granfeldts, Create Object WF activity to create dynamic groups.
    In a standard function evaluator activity I generate the Filter as [//WorkflowData/Filter]
    The "string" I set it to is:
    <Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect" xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Person[ObjectID
    = /*[ObjectID = '8dfcb5e8-ff01-400c-8ca7-2a0002d2d2d4']/ComputedMember]</Filter>
    In the CreateObject activity I then just have [//WorkflowData/Filter],Filter among the initial values.
    The creation works if I remove this attribute so the rest of the attributes seems to be working.
    The creation fails however end I get the error below in the Forefront Identity Manager event log.
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.ResourceManagement.WFActivities.Resolver.GetDisplayStringFromGuid(Guid id, String[] expansionAttributes)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ReplaceGuidWithTemplatedString(Match m)
       at System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat)
       at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator)
       at Microsoft.ResourceManagement.WFActivities.Resolver.GetStringAttributeValue(Object attribute)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ResolveEvaluatorWithoutAntiXSS(String match, ResolverOptions resolveOptions)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ResolveEvaluatorForWithAntiXSS(String match, ResolverOptions resolveOptions)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ReplaceMatches(String input, Boolean useAntiXssEncoding, ResolverOptions resolveOptions)
       at Microsoft.ResourceManagement.Workflow.Hosting.ResolverEvaluationServiceImpl.ResolveLookupGrammar(Guid requestId, Guid targetId, Guid actorId, Dictionary`2 workflowDictionary, Boolean encodeForHTML, String expression)
       at Microsoft.ResourceManagement.Workflow.Activities.ResolveGrammarActivity.Execute(ActivityExecutionContext executionContext)
       at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
       at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
       at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
       at System.Workflow.Runtime.Scheduler.Run()
    Have anyone used this WF activity to create dynamic groups and can tell how to set the Filter?

    Hey Kent!
    I did the same thing, with Søren`s Create Object WF. I did it like this on the filter part:
    <Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect" xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Person[(Department = '[//Target/ObjectID]')]</Filter>,Filter
    The whole thing looks like this:
    (I use Function evaluator to generate a AccountName for groups based on a clean version of DisplayName).
    [//Target/DisplayName],DisplayName
    SEC_[//WorkFlowData/CleanAccountName],AccountName
    [//Target/Manager],Owner
    Security,Type
    DOMAIN_STRING,Domain
    Universal,Scope
    [//Target/DisplayName]_SecGroup,Description
    [//Target/Manager],DisplayedOwner
    None,MembershipAddWorkflow
    True,MembershipLocked
    [//Target/CleanAccountName],MailNickname
    <Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect" xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Person[(Department = '[//Target/ObjectID]')]</Filter>,Filter
    Regards, Remi www.iamblogg.com

  • What is the use of passing object reference to itself ?

    What is the use of passing object reference to itself ?
    regards,
    namanc

    There is an use for returning an object reference from itself, for instance:
    class C {
    public:
         C append(C c) {
             // do something interesting here, and then:
             return this;
    }You can "chain" calls, like this:
    C c = new C();
    C d = new C();
    C e = new C();
    c.append (d).append (e);Maybe the OP has "inverted" the common usage, or thought about a static method of a class C that requires a parameter of type C (effectively being a sort of "non-static method").
    class C {
        static void doAnotherThing (C c) {
            c.doSomething(); //-- effectively C.doAnotherThing(c) is an "alternative syntax" for c.doSomething()

  • Create with reference using BAPI_SALESDOCU_CREATEFROMDATA

    Hi,
      I have been trying to use BAPI_SALESDOCU_CREATEFROMDATA to create with reference. I am trying to use the fields REF_DOC and REF_DOC_CA in structure ORDER_HEADER_IN
    but the created order is not copying any data from the referenced order. Aaprt from the ref order I am passing the sales area data and sold to customer. Am i missing something or is create with reference not supported?
    Regards,
    Hari.

    Hi,
    This bapi will work when you try to copy invoice to the credit memo request..pass the billing document number in salesdocument parameter and pass the sales document type(CMR type) in documenttype.
    Thanks
    Naren

  • Field-symbols v/s Object references in OO-ABAP

    Hi,
    can anyone please tell me what is the difference between using field-symbols and object references in OO ABAP? Is there a specific need for field-symbols now that we have references?
    Thanks.
    Shakul.

    Hi ,
    Please note that both Field symbols & Object References are different .
    You can use Field symbols during the following situations
    1) When you want to modify the value of internal table, the field symbol would be useful since you do not have to use any Modify statement as in case of work area. The Field symbol works as a pointer and any changes to the field symbol will directly affect the value of the internal table
    2) Make sure that you do not reassign the field symbol within a Loop iteration
    3) Field symbols are useful when you work with dynamic internal tables ( tables whose structure is determined during run time)
    4) After Read an internal table ( Read itab...) into a Field symbol, make sure you do a Sy-subrc check or check if the field symbol is assigned.IF not this will give you a run time error
    You can use Object References while creating an object to a class. They are instances of a class.
    Thanks,
    Chakram Govindarajan

  • ClassNotFoundException when creating objects

    Hi, am am pretty new to using java reflection and all that stuff - so this could be a fairly obvious question.
    I am using reflection to create objects whose names are only known at runtime. The method is as follows:
        public static IGene getRandomGene(Vector genes){
            int size = genes.size();
            int rndOp = (int)Math.floor(Math.random() * size);
            String newClassName = (String)genes.get(rndOp);
            IGene newGene = null;
            try {
                Class geneDefinition = Class.forName(newClassName);
                Constructor cons = geneDefinition.getConstructor(new Class[0]);
                newGene = (IGene)GeneUtils.createObject(cons, new Object[0]);
            } catch (ClassNotFoundException e) {
                System.out.println(e); //And the ClassNotFoundException is encountered
            } catch (NoSuchMethodException e) {
                System.out.println(e);
            return (OperatorGene)newGene;
        }The name of the class to be created (newClassName) is found fine.
    My includes are:
    package simplegp;
    import java.util.Vector;
    import java.lang.reflect.*;
    import simplegp.operandGenes.*;
    import simplegp.operatorGenes.*;
    import simplegp.operatorGenes.doubleOps.*;
    import simplegp.operatorGenes.singleOps.*;These includes definatly cover the classes to be included.
    Am i maknig a silly mistake? I cannot fingure it out.
    Many thanks for any help
    Adam
    PS. The code is for some evolutionay programming, hence havnig Genes

    I seem to have solved the problem - sorry for not searching the forums first.
    I had to specify the class names as:
    simplegp.operandGenes.IntOperandGene
    Rather than just: IntOperandGene
    adam

  • Error 1054 Open VI Object Reference

    Hi Ppl,
    I'm using LabVIEW 8.6 and I'm debugging a code that uses the  Open VI Object Reference node. The parent reference thats passed in is a refrence of a VI instance and the vi object class is the control type. Though the control is present in the VI, the node returns error 1054 and says object not found. 
    I'm wondering why this was. However when the parent is the VI reference itself instead of the instance VI this works. I'm not able to understand the problem.
    Thanks,
    Sathish

    Sorry, I made what you have told me:
    now i have this error:
     why? If you have implemented a correct Vi can you give me it please?
    Thanks!
    Attachments:
    ClearChart.vi ‏14 KB
    test.vi ‏12 KB

  • Using ME57 to create an RFQ from multiple lines on multiple PRs

    When using ME57 to create RFQs how can I select multiple line items from multiple purchase requisitions to turn into a single RFQ. If I select multiple lines and then use 'RFQ with Vendor', it only selects one line item.  After further research it appears that you can only create only line at a time (very time consuming). 
    If you use ME41 and create with reference to PR then you can not sort or filter columns to allow for easy consolidation.
    Another forum recommended the following when using ME57 which works but it again adds extra steps to the process.
         The whole process is as follows -
         1) When you are in the 'Assign and Process Purchase Requisition' screen, select related PR and then click on 'Without Vendor' icon to flag all PRs for RFQ processing.
         2) Select these PRs again and click further on 'Assignment Overview' icon (Shift and F5). The next screen will appear - Assign and Process requisitions - Overview of Assignments screen.
         3) Select the 'PReq' column and then click further on 'Process Assignment' icon (F2). The next screen will appear where you have to maintain the 'quotation deadline' information.
         4) Then click on 'Continue' icon (enter).
    [http://www.sapfans.com/forums/viewtopic.php?f=6&t=198768]
    So is there any way to either 1) enable sorting of data in ME41 or 2) use ME57 to create one RFQ from multiple line items of multiple purchase requisitions when selecting 'RFQ with Vendor'.

    What is the JPEG specs? What are the specs of the project you're working in?

  • VA01 copies texts, but VA02 does not when creating from reference

    Hello,
    I am having an issue with text determination configuration.  It is currently set up to copy some header texts from the quote to the order when an order is created from reference.  This works correctly when using transaction VA01 to create an order from reference.
    However, the issue arises when using VA02 to create from reference, the items copy over correctly from the quote, but texts and other data do not copy over correctly.  Any ideas on why this might be the case?
    Thanks,
    Tony

    Hi Everyone,
    Thanks for your replies.  I know the correct way to do this is to use VA01 and Create from reference.  However, the way that the order processing group has always done this is to create a "dummy" order using VA01, then use VA02 to "modify" the order by going to menu option Sales Document -> Create with Reference.  This has the effect of copying over all items from the quote into the order.  However, no sales texts are copied over when this is done.  I'm wondering if there is a config that needs to be modified to allow texts to copy over using this method.
    When I go into the texts tab in VA02 and display the log, the texts that I need copied over say something like, "Text does not exist".  I have a feeling that the text is not copied over because the order does not have a reference to the quote at the time the text determination is evaluated.
    Thanks,
    Tony

  • Using == with String object references

    Hi,
    I understand that using the == operator to compare two String object references in Java will yield false for two different object references even when the contents are the same, and that you are supposed to use the method .equals() instead. However, in my program the == operator actually works for two different object references that point to the same object since it yields true! I don't understand why it works in my program when it shouldn't. Does someone know why?
    Thanks!

    overrule. wrote:
    warnerja wrote:
    ... unless some sneaky thread jumps in and changes the a or b reference right before the expression (a == b) were evaluated. This would also assume a or b had greater scope than simply local method variables that only one thread could access.
    Just being a nitpickCould you provide an example of how that "greater scope" may look like in this case.
    * Greater scope.
    * @author Cynthia G.
    * @see http://forums.sun.com/thread.jspa?messageID=10520796
    public class ObjectAssignmentTest {
      static Object a; // outer scope: class variable
      static Object b; // outer scope: class variable
      public static void main(String[] args) throws InterruptedException {
        a = new Object();
        b = a;
        new Thread(new Runnable() {
          public void run() { ObjectAssignmentTest.b = new Object(); }
        }).start();
        System.out.println(a == b ? "equal" : "not equal");
    }For the record, this code is not even guaranteed to make the objects unequal with == before their equality is tested; both threads may go in parallel, the main thread first or the modifying thread first!
    s

  • How to create a local object reference variable in teststand sequence file programatically using C#

    I want to create a local object reference variable in a TestStand sequence file programatically using C#.

    Hi,
    Accoring to your reply in this Thread
    http://forums.ni.com/ni/board/message?board.id=330&thread.id=26984
    Just try this example. There you will create a numeric variable during excuting a sequence!
    Hope this is what you are looking for. 
    Please attach all your questions here.
    juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=
    Attachments:
    CTestStandDialog.zip ‏31 KB

  • String contains class name: how to use it for creating new objects

    Hi All
    I've seen things like this in scripting languages, so I was wondering if things like this are possible in java. Here is an not working example:
    String s = "MyClass" ;
    MyClass mc = new s() ; // or: s mc = new s() ;
    if ( mc instanceof s ) { ..... }
    Is something like this possible ?
    Thnx in advance
    LuCa

    jeanluca wrote:
    I've seen things like this in scripting languages, so I was wondering if things like this are possible in java. Here is an not working example:
    Is something like this possible ?AFAIK, it is only possible in a very limited way as noted above and is nearly always not recommended and definitely not necessary. The variable name has little importance, but OTOH the object reference has great importance. Instead learn about arrays, Lists, and Maps.

Maybe you are looking for

  • WebGL Renderer & GPU Accelerated Windows Blocked for your Graphics because of unresolved driver issues

    I am using Windows XP SP 2. My mother board is ASUS F1A55-MLX Plus, Processor: AMD A4-3400 APU with Radeon HD Graphics 2.70 GHz, 2GB DDR3 DIMM 1333 MHz RAM and 500 GB SATA HDD. I am using FF version 8. However, on some websites I cannot see the whole

  • JNI_GetCreatedJavaVMs() returns 0 nVMs

    Hello all I am currently experiencing a very annoying problem. I have a function CallJavaClient() that I need to call twice. (See below for listing). When I do the calls from within a console application, everything works fine, but when I perform the

  • Pixel Aspect?

    Hi there, I'm trying to learn about using FCP and Livetype. I'm reading a book which tells me to edit my project properties to ensure a .90 pixel aspect ratio as per standard DV. However, I don't see this anywhere in the file information in FCP. Does

  • Inserting maps in Appleworks word processing doc

    I am writing a family history book, using photos and maps. I am having trouble when I insert a jpeg map into the word processing document. It prints out perfectly from the scan in the Photo Elements program, but ends up distorted when I insert it in

  • Opening templates,  wrong language - need english

    I am opening templates in iAuthor and am getting the wrong language. I need english. Anyone have a tip of what I need to do in order to fix this? My lion OS is set with English as default. thanks in advance, Linda