Creating a dynamic number of objects

Hi,
I write a program that has to use a dynamic number of object let say Strings (st1, st2, st3.....)
for (i=1;i<4;i++){
String "str"+i = new String (" ");
How do I do that?
Eli

use collections. list. hashtable or something like that. even an array would be ok and keep adding data to it

Similar Messages

  • Can I create a dynamic number of inputs during runtime?

    Can I create a dynamic number of inputs during runtime?
    Oracle 11g
    Application Express 4.0.2.00.06
    Here is my problem:
    We have a table that holds metadata about files (hardcopy or softcopy files).
    We expect we may need more columns in the table at some point and don't want to modify the table or the application.
    So in order to do this I would like to create:
    A table called TBL_FILE with the columns:
    TBL_FILE_ID               NUMBER                (This will be the primary key)
    TBL_FILE_NAME          VARCHAR2(1000) (This will be the name of the file)
    A second table will be called TBL_FILE_META with the columns:
    TBL_META_ID               NUMBER               (This will be the primary key)
    TBL_FILE_ID               NUMBER                (This will be the forign key to the file table)
    TBL_META_COLUMN     VARCHAR2(30)     (This is what the column name would be if it existed in TBL_FILE)
    TBL_META_VALUE          VARCHAR2(1000) (This is the value that record and the 'would be' column)
    So a person can have as much meta data on the file with out having to add columns to the table.
    The problem is how can I allow users to add as much data as they like with out having to re develop the page.
    Other things to note is that we would like this to be on a single page.
    I know how to add we can create multi-row inserts by using a SQL Query (updateable report),
    however the TBL_META_VALUE column in the TBL_FILE_META will sometimes be a select list and other times a text box or number field.
    So I don't see now a SQL Query (updateable report) would work for this and I can't create an array of page items at run time can I?
    Any idea's how I could accomplish this? Is there a better way of doing this?
    Also is there a term or a name for what I am doing by creating these 'virtual' columns in another table?
    I found this method when looking at Oracles Workflow tables.

    Welcome to the Oracle Forums !
    >
    Can I create a dynamic number of inputs during runtime?
    Oracle 11g
    Application Express 4.0.2.00.06
    Here is my problem:
    We have a table that holds metadata about files (hardcopy or softcopy files).
    We expect we may need more columns in the table at some point and don't want to modify the table or the application.
    So in order to do this I would like to create:
    A table called TBL_FILE with the columns:
    TBL_FILE_ID NUMBER (This will be the primary key)
    TBL_FILE_NAME VARCHAR2(1000) (This will be the name of the file)
    A second table will be called TBL_FILE_META with the columns:
    TBL_META_ID NUMBER (This will be the primary key)
    TBL_FILE_ID NUMBER (This will be the forign key to the file table)
    TBL_META_COLUMN VARCHAR2(30) (This is what the column name would be if it existed in TBL_FILE)
    TBL_META_VALUE VARCHAR2(1000) (This is the value that record and the 'would be' column)
    So a person can have as much meta data on the file with out having to add columns to the table.
    The problem is how can I allow users to add as much data as they like with out having to re develop the page.
    >
    Creating Page Items dynamically is not available. You will have to create excess items and hide/show , etc. But you cannot change the Item Type. All in all, too many limitations in this approach.
    >
    Other things to note is that we would like this to be on a single page.
    >
    The 100 item limit will hit you if you go with extra item on page. With Tabular Form that should not be a limitation, unless you are exceeding the 50 item limit of APEX_APPLICATION.G_Fnn items, and the 60 column limitation of Report region with "Use Generic Column Names (parse query at runtime only)" of Dynamic region.
    >
    I know how to add we can create multi-row inserts by using a SQL Query (updateable report),
    however the TBL_META_VALUE column in the TBL_FILE_META will sometimes be a select list and other times a text box or number field.
    >
    If the type if item is variable it only means you need a way to store the item type. Meta Data of the Meta Data.
    >
    So I don't see now a SQL Query (updateable report) would work for this and I can't create an array of page items at run time can I?
    >
    Yes, you can do it. Updatable report/ Tabular Form query can be constructed from the Meta Data using PL/SQL Function Returning SQL Query . It will be a bit of coding in PL/SQL where you use the Meta Data and the Meta Data of the Meta Data to piece together your SELECT with the right APEX_ITEMs. It might have a performance penalty associated with it, but will not be a serious degradation.
    >
    Any idea's how I could accomplish this? Is there a better way of doing this?
    Also is there a term or a name for what I am doing by creating these 'virtual' columns in another table?
    I found this method when looking at Oracles Workflow tables.
    >
    I guess that is just a good TNF. It is the Master-Detail Design Pattern, that sound more modern ? ;)
    Regards,

  • Error when creating interval for number range object

    Hi,
           I am trying to transport my BW stuff from QA to Production and I am getting the following error in the transport logs. The info objects are inactive in RSA1.
    Start of the after-import method RS_IOBJ_AFTER_IMPORT for object type(s) IOBJ (Activation Mode)
    Characteristic YRESD: Error when creating interval for number range object BIM0000396
    Can some body advise me what's wrong? Is something need to be maintained in number ranges?
    Also when I am checking the objects in RSA1, I am getting a message saying "source system WD110 does not exist", WD110 is our dev system. How can I change the source system after transport?
    Thanks.
    Edited by: Raj G on Mar 20, 2008 11:38 AM

    Also when I am checking the objects in RSA1, I am getting a message saying "source system WD110 does not exist", WD110 is our dev system. How can I change the source system after transport?
    Which system are you checking this?
    refer: Re: Transport Source Systems from DEV to Testing for step to map the source systems for transport

  • How to create Dynamic number of attachments in BPM Process ?

    Hi All,
    I have a requirement to create a dynamic number of attachments, as per need. I am aware of attachment.create() but i believe with this i can only create only the fixed number of attachments. Is there any way by which i can play around with create() api or is there any other API to fullfill the requirement??
    Any response is well appreciated.
    Regards,

    Hi,
    You can create the n-items in the region by creating items in the controller. i mena to see say by looping..
    Thanks,
    Kumar

  • Dynamic number range

    hi friends,
    I'm working on module pool programming.How to generate dynamic numbers when user saves the data?
    thanks in advance.

    Hello Hosmath
    You could create your own number range object (transaction SNRO ) for your application.
    To retrieve the next number use fm NUMBER_GET_NEXT (input: range object & number range).
    Regards
      Uwe

  • Z Number range objects in ECC 6.0

    Dear SMRer's,
    System Info: SRM 5.0 and ECC 6.0
    I created some Z number range objects for eforms in ECC 6.0. And all of them went in to the same transport request DXXXXXXX . I just wanted to confirm if it is the right way to do it.
    Also, if some one can throw light on the transport mechanism that would be great.
    Points will be rewarded for answers,
    Best regards,
    Bob

    Hi,
    Usually best practice is to not transport number range but to recreate it in the target system.
    However, technically it is possible.
    Kind regards,
    Yann

  • SNRO - Creation of Number range object problem

    Hi Experts,
    i wanted to create a number range object thru SNRO.
    The creation was successful in DEV system.
    when i tried to create the same number range object in QA server, i am getting the following error
    "Changes to Repository or cross-client Customizing are not permitted - Choose 'Display object' or 'Cancel'."
    this is a Znumber range used to generate sequential numbers using FM NUMBER_GET_NEXT
    What could be the problem. how to over come this?
    Is it the missing authorizations? if so what could be the authorization object (SU53 shows nothing)
    Appreciate any help in this regard.
    Thanks
    Simha

    Hi All,
    I am confused with the conflicting answers for my problem. But anyways i could transport the number range object and could create a number range interval in QAS.
    Thanks a lot for all your valuable inputs.
    But i am still not out of this so called misconception - Are number range objects to be transported to QA or to be created afresh in QA/PRD?
    Earlier some one told to be created but now i see they can be transported.
    I was not ready to edit the options in SCC4 for the client to enable object creation.
    Thanks again,
    Simha

  • Steps to create LOV dynamically

    Hello All,
    I want to create LOV dynamically.in my Oracle Forms 6I
    Is there any code which can create LOV dynamically using coding.
    I can create Record group dynamically. but I want to create LOV dynamically not from object browser of Form Builder by pressing Add LOV option.
    Kindly help me.
    Thanks
    HARSH SHAH

    Forms does not have a Built-in for dynamically creating an LOV; these objects can only be created in the Forms Builder during design time.  You can, as numerous people have tried to demonstrate, change the Record Group an LOV uses dynamically.  Unless you are changing the Column Mapping Properties of the LOV, using different Record Groups to supply the data for an LOV should work for you.  If you need to change the Column Mapping Properties, then you will need to create multiple LOV objects with the different mapping you need and then assign the LOV to your Item dynamically.
    Hope this helps,
    Craig...

  • Copy plant without number range objects

    Hi
    I created new plant by copying from existing one.
    I choose option not to transport Number Ranges. I got the message new plant was created without 6 number range objects.
    After transporting customizing into test system I got errors due to incorrect number ranges (ie. during PO creation).
    What number ranges I need to set up manually now in test and than in Prod so everytning is on right track?
    thanks for hints.

    HI,
    SEND US THE ERROR MESSAGE WHAT YOU ARE GETTING?
    BUT FOR INFO FOLLOW THIS,
    TRANSACTION CODE:SNRO
    Object                         :EINKBELEG
    HERE ABOVE THERE IS ICON NUMBER RANGE SELECT THAT AND GO TO CHANGE INTERVALAND INSERT THE INTERVAL .
    I HOPE THIS WILL HELP YOU

  • Number range object issue

    I have created a new number range object in SAP and transported the same to quality system.
    But only the name has gone but the number range has not been reflects in the Quality system
    why?

    Hi,
    Activate the number range object and execute the report 'RV80HGEN ' in SE38.
    Thanks & Regards,
      Rajani MV.

  • Interval 01 was not created for number range object HRTEM_REFN

    Dear expert!
    Now, I'm getting some issues in Training and event management module.
    - The first, I created business event
    - Second, I process to book for business event by tcode: PSV1 --> book --> book/payment info --> activity allocation.
    But when I was booking, the system displayed error: "Interval 01 was not created for number range object HRTEM_REFN"
    Help me, please!
    Best regards, Huy!

    Go to the customization as below
    Training and event mgt>Basic settings>Number range maintanence>Define number ranges for External operation
    and maintain number ranges as 01 Internal
    Hope ur problem will solve
    with regards
    partha

  • Best Way to Handle Dynamic Initialization of x number of Objects?

    I want to be able to take a x value(integer) that I get from another part of my program and initialize x number of Objects. Best way to handle that?

    myObject[] myObjArray = new myObject[x];
    for (int i=0; i<x; i++) myObjArray[i] = new myObject("obj#"+i);

  • Populating a dynamic array with objects and managing it in runtime.

    So I'm another stuck firstyear. I'll try and make my question compact. I'm using Flash CS6 and have drawn an animated character on the stage that consists of separate parts that are animated and its head is a separate class/symbol entirely because it has not only animation, but a state switch timeline as well. This said Head extends the Main that is the character MovieClip.
    I am using a dynamic array to store and .push and .splice objects of another class that would collide with this said Head.
    I also discovered the super() function that is implicitly called as the constructor of the parent in any child class that extends the parent, in this case Head extends Main. The issue is that my collidable object array is populated within the main, within the function that spawns every next collidable object with a TimerEvent. This said function then gets called twice due to the super() call.
    I have tried putting this super() call into an impossible statement in my child class, but it doesn't change a thing, and it was said that this method is unsafe so I don't even know if it should be working.
    However what confuses me the most is when I trace() the .length of my collidable object array at the end of that function. As I said earlier, the original function both spawns an object after a period of Timer(1000) and adds it to the stage as well as adds the object onto the object array, but the super() constructor only duplicates the length call and a creates a copy of the object on the stage, but it does not add the second copy of the object onto the array. The trace() output goes on like so:
    1
    1
    2
    2
    3
    3
    4
    4
    etc.
    I wonder why and I'm really stumped by this.
    Here is the code in question:
    public class Main extends MovieClip {
                        public var nicesnowflake: fallingsnow;
                        var nicesnowflakespawntimer: Timer = new Timer(1000);
                        public var nicesnowflakearray: Array = new Array();
                        public function Main() {
                                  nicesnowflakespawntimer.addEventListener(TimerEvent.TIMER, nicesnowflakespawn);
                                  nicesnowflakespawntimer.start();
                        public function nicesnowflakespawn(event:TimerEvent) : void {
                                  nicesnowflake = new fallingsnow;
                                  nicesnowflake.x = Math.random()* stage.stageWidth;
                                  nicesnowflake.y = - stage.stageHeight + 100;
                                  nicesnowflakearray.push(nicesnowflake);
                                  stage.addChild(nicesnowflake);
                                  trace(nicesnowflakearray.length);
                                  for (var i:Number = 0; i < nicesnowflakearray.length; i++){
                                            nicesnowflakearray[i].addEventListener(Event.ENTER_FRAME, snowhit);
                        public function snowhit(event:Event) : void {
                                  if (nicesnowflakearray[0].y >= 460){
                                            if (nicesnowflakearray[0].y == stage.stageHeight) {
                                            nicesnowflakearray.splice(nicesnowflakearray.indexOf(nicesnowflake), 1);
                                  //if (this.hitTestObject(nicesnowflake)){
                                            //trace("hit");
    I am also fiddling with the collision, but I believe that it would sort itself out when I deal with the array pop and depop properly. However I'm pasting it anyway in case the issue is subtly hidden somewhere I'm not looking for it. And here is the child class:
    public class Head extends Main {
                        public function Head(){
                                  if (false){
                                            super();
                                  this.stop();
    So like what happens at the moment is that the array gets populated by the first object that spawns, but there is two objects on the stage, then when the objects reach stage.460y mark the array splices() the one object away and displays an error:
    "#1010: A term is undefined and has no properties.
              at Main/snowhit()"
    then when the next object spawns, it repeats the process. Why does it trace the array.length as "1, 1, 2, 2, 3, 3, 4, 4, 5, 5, etc" until the despawn point and then goes on to display an error and then starts from 1 again, because if the array length is more than one object at the time when the first object of the array gets spliced away, shouldn't it go on as usual, since there are other objects in the array?
    Thank you very much to whomever will read this through.

    There are multiple problems:
    1. You should add eventlisteners for your objects only once, but you add eventlisteners every time your timer runs to all of your snowflakes, again and again:
                                  for (var i:Number = 0; i < nicesnowflakearray.length; i++){
                                            nicesnowflakearray[i].addEventListener(Event.ENTER_FRAME, snowhit);
    change it to
    nicesnowflake.addEventListener(Event.ENTER_FRAME, snowhit);
    I don`t see why its even necessary to employ this snowflakearray, it would be much straight forward if you simply let the snowflakes take care of themselves.
    2. Then you have to change your enterframe function accordingly
    public function snowhit(event:Event) : void {
                                  if (e.currentTarget.y >= 460){
                                            if (e.currentTarget.y == stage.stageHeight) {
                                            e.currentTarget.removeEventlistener(Event.ENTER_FRAME, snowhit);
                                            removeChild(e.currentTarget);
    3.
                                  //if (this.hitTestObject(nicesnowflake)){
                                            //trace("hit");
    since "this" is a reference to the Main class (root) it surely won`t function as you intend it to.
                                  if (false){
                                            super();
    makes no sense to use a condition that can never be true

  • ADF triggering dynamic number of components

    I have a three-level View object dependency Category -> Class -> Subclass and want to create a dynamic form with the following logic:
    When user chooses a Category from drop down, page is updated with a number of Class drop-down lists presenting all the Subclasses - i.e. I have a dynamic number of selectOneChoice components depending on Category selection. Category to Class dependency is implemented with Category valueChangeListener querying Classes with category Id, Class to Subclass is simple View Link / tree value binding. Subclass value binding to backing bean is done with a HashMap.
    Does ADF faces framework let me re-create actual page components with partial page rendering (or some other mechanism)?
    I should fully re-generate all selectOneChoice components inside forEach every time user changes Category.
    My page components:
    <af:selectOneChoice value="#{bbean.category}"
    label="Category"
    autoSubmit="true" immediate="true"
    id="category" valuePassThru="true"
    valueChangeListener="#{bbean.categoryChanged}">
    <f:selectItems value="#{bindings.Categories.items}"/>
    </af:selectOneChoice>
    <af:forEach var="class" items="#{bindings.Classes.children}">
    <af:selectOneChoice value="#{bbean.subclass[class.id]}"
    label="#{class.name}"
    partialTriggers="category"
    id="class" valuePassThru="true">
    <af:forEach var="subclass" items="#{class.children}">
    <af:selectItem label="#{subclass.name}" value="#{subclass.id}"/>
    </af:forEach>
    </af:selectOneChoice>
    </af:forEach>
    The above code is a development from earlier less-complex UI. For all I've tried I cannot come up with the desired effect. When I change Category it doesn't affect sub- drop downs in any way. If I activate the Category valueChangeListener, Category change will cause validation phase null property exceptions:
    2.9.2008 14:05:40 com.sun.faces.lifecycle.ProcessValidationsPhase execute
    SEVERE: Error testing property 'null' in bean of type my.project.view.managed.Search$1
    javax.faces.el.PropertyNotFoundException: Error testing property 'null' in bean of type my.project.view.managed.Search$1
    ...

    John & Frank,
    Unfortunately enclosing layout component with partialTriggers="category" doesn't help - I've tried that already (panelgroup & panelpage, that is). Thanks for impressive response time though ;)
    Edit: Sorry, yes it helps! Thanks. The problem happens to be the HashMap value binding, it breaks up things after valueChangeListener refreshes the Class VO. After removing that the surrounding panelGroup does component refresh correctly. Back to drawing board..
    Erik
    Edited by: Erik Westerinen on Sep 2, 2008 5:26 AM

  • Creating listeners dynamically...

    Hi,
    I have an external swf that I'm loading into Flash and attempting to make some communication happen between the swf and the parent loader.
    In the external swf, I have a series of events being dispatched based on which frame the user is on, i.e.:
    dispatchEvent(new Event("1"));
    dispatchEvent(new Event("2"));
    dispatchEvent(new Event("3"));
    I'm trying to create a generic listener function that will add multiple eventListeners to the stage based on an arbitrary number which will in turn listen for the events being dispatched from the external swf, like so:
    function ListenForNavFromExternalAsset(sectionLength:int):void
        for(var i:int = 0;i<sectionLength;i++)
            var screenNum = '"' + i + '"';
            stage.addEventListener(screenNum, NavToScreenFromExternalAsset, false, 0, true);
            trace(screenNum);
    I can see screenNum tracing out, so I know the function is executing.
    However, the events are clearly not being added to the stage, as I never see the traces below, even though the external swf is definitely dispatching its events:
    function NavToScreenFromExternalAsset(e:Event):void
        trace("ADDED_TO_STAGE");
        if(e == Event("1"))
            trace("NavToScreenFromExternalAsset: ONE");
        else if(e == Event("2"))
            trace("NavToScreenFromExternalAsset: TWO");
    //etc..
    There must be a better way to do this that I'm not aware of, I've had much success in the past using dispatchEvent and capturing the event, but I'm not sure how to create listeners dynamically and listen for a dynamic string.
    If anyone can suggest a path forward, I would be much oblidged.
    Thx for reading,
    ~Chipleh

    You might want to look into using the CustomEvent class.  It supports passing arguments with the dispatched event, which in your case could be the numbers you want to identify.  That way you could have one listener assigned to the loaded swf after it is loaded, and one event handler that reads the argument passed by the event.
    Although I believe that Flash has the class somewhere, here it is...
    package
         import flash.events.Event;
         public class CustomEvent extends Event
              public var params:Object;
              public function CustomEvent(type:String, params:Object, bubbles:Boolean = false, cancelable:Boolean = false)
                   super(type, bubbles, cancelable);
                   this.params = params;
              public override function clone():Event
                   return new CustomEvent(type, params, bubbles, cancelable);
              public override function toString():String
                   return formatToString("CustomEvent", "params", "type", "bubbles", "cancelable", "eventPhase");
    Usage:
    import CustomEvent;
    To dispatch:
    dispatchEvent(new CustomEvent("myEvent", {property: "blah", anotherProperty: 456});
    To read in event handler:
    function eventHandler(e:CustomEvent):void{
         trace(e.params.property, e.params.anotherProperty);

Maybe you are looking for

  • How to remove file path location listings from photos and objects in Acrobat Pro 9.0 PDF?

    After converting a windows-based Powerpoint 2007 presentation to an Acrobat Pro 9.0 PDF, the file path location of all photos and objects are shown in a dialogue box when the cursor is moved over the image as seen in this screenshot below. How can I

  • PDF quality issues on Adobe Reader for Pocket PC 2.0

    The quality of PDF's rendered by Adobe Reader 2.0 PPC is awful when compared to Adobe Reader LE. We are running it on HTC X7500's with a nice 5" display, but you have to zoom in +5x to read the text on our parts manuals, where as LE renders the same

  • Could someone explain me about ADF Security in UI Shell?

    Hello. I have my application main page implemented with a dynamic region and it's working fine. The application is secured using ADF Security and it is fine too. All the bounded taskflows are imported as ADF Libs. They have their permissions in jazn-

  • My iPod does not start, i dont know why !!!

    Hi first. I'm glad to be here. My iPod 60GB Video, does not start. I have try many methods to start it but its not starting. I was changin themes in iPod and its turned off, and doesn't start anytime. Have anyone any answer ( answer which can help me

  • Problems to differentiate between attachments and embedded in an email

    In my code i have something like that to verify if the attachment is embedded or not: public static bool IsEmbeddedAttachment(Outlook.Attachment attachment) //Anexos que não são embedded são obrigatóriamente olByValue, porém os embedded podem ser de