Creating objects dynamically

can we create objects(instance of a class in other class) with repect to time
that is i want to create an object for every 30 sec can we do that
iam new to java can anyone help me

There are serveral ways, but creating objects is meaningless without doing something with them.
Thread.sleep() is the simplest call to wait an interval like 30 seconds or you can use a Timer object to call a piece of code periodically.
But I have the feeling that you're coming at the thing from the wrong end.

Similar Messages

  • ABAP OO, Creating object dynamically

    Hi everybody,
         I’m currently working on some Abap OO examples. Everything is working ok except for the following: Creating objects dynamically.
    This is what I’d like to do:
    Lets say we obtain a bunch of sales orders using a simple select statement and place them in an internal table. For each entry in our internal table, I’d like to generate a new sales order object. This salesorder object is a simple class with a constructor with an Id and some other attributes.
    When this is done, I’d like to append every object to a new object, say basket, so that this basket contains something like an internal table within each record a reference to the salesorder. Is this easy to do? I’m using the example that is described in the sap guide (create object pointer type (class_name) but it looks to me that you still have to declare the reference variables before you can create the object.
    Hmm, I think Java is better suited for a job like this.
    Hope you can help,
    Cheers and Best wishes
    Laurens Steffers
    The Netherlands.

    Hi,
    Its not all that difficult in ABAP as well. The following code is based on Chapter 5, Listing 5.20 from book ABAP Objects.
    What you need is an internal table of type <your sales object> e.g.
    DATA: BEGIN OF obj_sales_order
            sales_order_no LIKE <sales_order_no_type>,
            <...>,
            objref TYPE REF TO <SALES_ORDER_CLASS>
          END OF obj_sales_order,
          reftab LIKE SORTED TABLES OF obj_sales_order
                      WITH UNIQUE KEY sales_order_no
                                      <other key attributes>.
    Now all you need to do is to do a SELECT...ENDSELECT loop, and:
    SELECT ...
    obj_sales_order-sales_order_no = <selection result>
    obj_sales_order-<other key attr> = <selection result>
    READ TABLE reftab INTO obj_sales_order
                      FROM obj_sales_order.
    IF sy-subrc <> 0.
      CREATE OBJECT obj_sales_order-objref
             EXPORTING ...
             EXCEPTIONS ...
      IF sy-subrc <> 0.
        MESSAGE ...
        CONTINUE.
      ELSE.
        INSERT obj_sales_order INTO TABLE reftab.
      ENDIF.
    ENDIF.
    CALL METHOD obj_sales_order-objref-><method>.
    ENDSELECT.
    Hope this help.
    Regards

  • How to create objects dynamically (with dynamic # of parameters)

    I need to create a set of objects based on a definition from an XML file (obtained from the server) and add them to my scene.
    I understand how to create the object using getDefinitionByName (and the limitations regarding classes needing to be referenced to be loaded into the SWF).
    But some objects require parameters for the constructor, and some don't. The XML can easily pass in the required parameter information, but I can't figure out how to create a new object with a dynamic set of arguments (something akin to using the Function.call(obj, argsArray) method.
    For example, I need something like this to work:
    var mc=new (getDefinitionByName(str) as Class).call(thisNewThing, argsArray)
    Currently this is as far as I can get:
    var mc=new (getDefinitionByName(str) as Class)(static, list, of, arguments)
    Thoughts?

    I think what Dave is asking is a bit different.
    He's wanting to know how to invoke the constructor of an object dynamically (when he only knows the # of constructor arguments at runtime).
    This class I know will do it but seems to be a hack:
    http://code.google.com/p/jsinterface/source/browse/trunk/source/core/aw/utils/ClassUtils.a s?spec=svn12&r=12
    See the 'call' method, which first counts the # of arguments then invokes one of 'n' construction methods based on the number of constructor args.
    I've yet to find a clean AS3 way of doing things ala 'call' though.
    -Corey

  • Create ABAP object dynamically

    Is it possible to create objects dynamically?
    so that the name of the class is set via parameters and also the variables and which class is the superclass?
    something like:
    fieldsymbols: <a> type any.
    data: data_object type ref to object.
    create new class type data_object.
    data_object-name = 'dynamic'.
    data_object-subclass = 'superclass'.
    create object <a> like class 'dynamic'
    <a>-(method of superclass)(   ) etc...
    It is not ABAP code, but i hope you know what i mean?
    Kindly hear from you!
    Anton Pierhagen

    You can use dynamic reference to instantiate your objects.
    Like:
    data: lo_ref type ref to object.
    create object lo_Ref type ('ZCLASS').
    call method lo_ref->('METH_1').
    But problem in this design would be that your class & method name is hardcoded and it would be only checked at runtime, not at the design time. To overcome, this you can use the [Factory Method Design pattern|http://help-abap.zevolving.com/2011/10/abap-objects-design-patterns-factory-method/].
    Regards,
    Naimesh Patel

  • Creating object class dynamically

    Hi ,
    I need to create object dynamically for a class.eg when i loop thru internal table i need to create an object per pass of the loop and no of entries  in itab can be known at runtime only
    Any clues
    Regards
    Swatantra

    Check this sample program, where it is creating a number of objects and appending them to a object list. 
    report zrich_0001.
    types: begin of telements,
           element(30) type c,
           value(30) type c,
           end of telements.
    *       CLASS lcl_element DEFINITION
    class lcl_element definition.
      public section.
        data: ielements type table of telements,
              xelements type telements.
        methods: constructor importing im_elements type telements,
                 write_out.
    endclass.
    *       CLASS lcl_element IMPLEMENTATION
    class lcl_element implementation.
      method constructor.
        append im_elements to ielements.
      endmethod.
      method write_out.
        loop at ielements into xelements.
          write:/ xelements-element, xelements-value.
        endloop.
      endmethod.
    endclass.
    data: itab type table of telements with header line.
    data: r_element type ref to lcl_element.
    data: r_elementlist type table of ref to lcl_element.
    start-of-selection.
    * Create the initial list of elements.
      itab-element = 'ELEMENTA'.
      itab-value   = 'Val_A'.
      append itab.
      itab-element = 'ELEMENTB'.
      itab-value   = 'Val_B'.
      append itab.
      itab-element = 'ELEMENTC'.
      itab-value   = 'Val_C'.
      append itab.
    * Create instances of the element object
    * and add to the list
      loop at itab .
        create object r_element
            exporting
                 im_elements = itab.
        append r_element to r_elementlist.
      endloop.
    * loop at the list and write out the element objects.
    * Notice that the r_elementlist is an internal table
    * which contains 3 objects.  Those three objects each
    * contain 1 internal table with one record each.
      loop at r_elementlist into r_element.
        call method r_element->write_out.
      endloop.
    Regards,
    Rich Heilman

  • Access dynamically created objects

    Hello!
    I create some images dynamically by running a for from 1 to a
    variable preset. The pictures have the IDs image1, image2 ...
    ("image"+i). I then add other properties.
    Problem is for each I need an onMouseOverHandler thant will
    swap the image with another.
    I can get the target image with event.currentTarget.id. But I
    cannot set it's properties with this["image"+i].source (I need to
    change the ones up to that as well) and I cannot access it with
    this.getChildByName("image"+i).source either.
    What am I doing wrong please?

    "M*A*S*H 4077" <[email protected]> wrote in
    message
    news:go74q6$fbb$[email protected]..
    > Hello!
    >
    > I create some images dynamically by running a for from 1
    to a variable
    > preset.
    > The pictures have the IDs image1, image2 ...
    ("image"+i). I then add other
    > properties.
    >
    > Problem is for each I need an onMouseOverHandler thant
    will swap the image
    > with another.
    > I can get the target image with event.currentTarget.id.
    But I cannot set
    > it's
    > properties with this["image"+i].source (I need to change
    the ones up to
    > that as
    > well) and I cannot access it with
    this.getChildByName("image"+i).source
    > either.
    >
    > What am I doing wrong please?
    ID is about as useful as your appendix when you create
    objects dynamically.
    The event.target property will contain a reference to your
    image.

  • Creating and Binding View Objects dynamically : Oracle Jdeveloper 11g

    Hello,
    We are trying to create and bind view objects dynamically to adf data visualization components.
    The view object is a result of multiple tables.
    We are using Oracle JDeveloper 11g Technical Preview. ( can't upgrade to TP2 or TP3 now).
    We have found this : http://radio.weblogs.com/0118231/stories/2003/07/15/creatingUpdateableMultientityViewObjectDefinitionsDynamically.html on our search for the same.
    The sample application however, is in 10g , hence required migration.
    Also, it was a standalone application with the TestClient.java having a main() method.
    Our requirement is for Web Application; we use Adf+jsf .
    Guidance of any sort is very much appreciated.
    Thanks in advance.
    -Anil Golla

    Hi,
    there also exist a forum for JDeveloper 11: JDeveloper and OC4J 11g Technology Preview
    What you are trying todo is not trivial because you need to not only dynamically create the VO, you would also dynamically need to create the binding meta data for it (assuming you use ADF). Not sure if the API to modify the binding is public, so posting it on the JDeveloper 11 forum bears a glimpse of hope for an answer
    In JDeveloper 10.1.3 you can't do this
    Frank

  • ABAP OBJECTS: Dynamic Create object

    Hi folks!
    I have a problem... I need to create a dynamic type object with:
    <b>DATA: my_instance TYPE REF TO class1.
    CREATE OBJECT my_instance TYPE (class2).</b>
    <i>* where class1 is a superclass of class2.</i>
    When I do:
    <b>my_instance ?= m_parent.</b>
    <i>* where m_parent is an instance of class1</i>
    My problem is when I want to access to an attribute of the class2, the compiler says that it cannot find the attribute <i>(this is OK, because the attribute is only in the class2).</i>
    My question:
    Is there anyway to access to an atribute of second class when is not in the first class? (i don't want to create the attribute as an attribute of the first class).
    Thanx!!!!

    Hi David,
    When you do the debugging, you are dealing with run-time - i.e., the program is now running and you are just interrupting it at each statement to examine the program state. You will reach the point where the object is already created. That is why you can see all those attributes. But when you comiple, the program is not yet <i>running</i>, so the attributes will be unknown because of the dynamic type specification.
    I think you will have to redesign the program logic. As i had already said in my earlier post, it is not proper to have the attributes specified statically while the class itself is specified dynamically.
    Your situation is somewhat similar to -
    DATA ITAB TYPE TABLE OF SPFLI.
    PERFORM TEST TABLES ITAB.
    FORM TEST TABLES ITAB.
      LOOP AT ITAB.
        WRITE: / ITAB-CARRID.
      ENDLOOP.
    ENDFORM.
    Hope the point is clear.
    Regards,
    Anand Mandalika.

  • 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:
    &lt;Filter xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; Dialect=&quot;http://schemas.microsoft.com/2006/11/XPathFilterDialect&quot; xmlns=&quot;http://schemas.xmlsoap.org/ws/2004/09/enumeration&quot;&gt;/Person[ObjectID
    = /*[ObjectID = &apos;8dfcb5e8-ff01-400c-8ca7-2a0002d2d2d4&apos;]/ComputedMember]&lt;/Filter&gt;
    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

  • How to create a lock object dynamically ?

    Hi all,
    I have a report with  a selection screen having one parameter in which the user can put a table name(Custom table) and some other paremeters.Based on these parameters I need to delete records from table put on the selection screen.Before deeting I need to lock the table. As beforehand I dont know the table name how can I create lock object dynamically lock my table ?
    Please suggest some idea...

    Hi,
    check below link
    lock objects
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/7b/f9813712f7434be10000009b38f8cf/frameset.htm
    Regards,
    Madhu

  • How to Create View Object Dynamically

    Hi,
    I hav a requirement to create a view object dynamically.
    can anybody plz help me.
    Thanks
    Nan:)

    Hi,
    oracle.apps.fnd.framework.server.OAApplicationModuleImpl amImpl = (oracle.apps.fnd.framework.server.OAApplicationModuleImpl)AM;
    OAViewDef viewDef = AM.getOADBTransaction().createViewDef();
    viewDef.setSql(sql.toString());
    viewDef.setExpertMode(true);
    //viewDef.setViewObjectClass("oracle.apps.fnd.framework.server.OAViewObjectImpl");
    //viewDef.setViewRowClass("oracle.apps.fnd.framework.server.OAViewRowImpl");
    oracle.jbo.ViewObject oaviewobject=amImpl.createViewObject("TableVO",viewDef);
    if(oaviewobject !=null)
    TableBean.setViewUsageName("oaviewobject");
    TableBean.setViewAttributeName("TncId");
    Thanks
    Nani:)

  • Dynamically created object

    Hi
    I did not find any way of accessing a dynamically created
    object by using notation this[id].
    As the code below shows, only hard coded id objects are
    recognised by this[id] notation.
    Any way to do it ?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    import mx.controls.*;
    public var l:Label;
    public function init():void {
    l = new Label();
    l.id = 'label1';
    l.text = 'firstname';
    addChild(l);
    public function fred(event:Event):void {
    mytextarea1.text+=this['mytextarea1'].name + '\n';
    mytextarea1.text+=this['label1'].name + '\n';
    ]]>
    </mx:Script>
    <mx:TextArea id="mytextarea1" width="1300"
    height="200"/>
    <mx:Button click="fred(event)" />
    </mx:Application>

    Thanks guys but I think my example is too simple compared to
    my "real world" current problem ...
    In my project, I dynamically create containers and children.
    I'd like to reach directly a then dynamically created child by its
    id, but notation this[id] is not recognised.
    A better example : form f1 (id='form1) contains 2 labels (ids
    'form1label1' and 'form1label2') ; f1 is included in form f0.
    Calling this['form1label1'] crashed even though it is a
    declared id control ! The same example using <mx> tags would
    not crash...
    And I have gone aroud 10000 articles but never found an
    answer to this.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    import mx.controls.*;
    import mx.containers.*;
    public function init():void {
    var f0:VBox = new VBox();
    var f1:VBox = new VBox();
    var l:Label;
    f0.id = 'form0';
    f1.id = 'form1';
    l= new Label();
    l.id = 'form1label1';
    l.text = 'mobile';
    f1.addChild(l);
    l = new Label();
    l.id = 'form1label2';
    l.text = 'work';
    f1.addChild(l);
    f0.addChild(f1);
    addChild(f0);
    public function fred(event:Event):void {
    mytextarea1.text+=Label( this['form1label1'] ).text + '\n';
    ]]>
    </mx:Script>
    <mx:TextArea id="mytextarea1" width="1300"
    height="200"/>
    <mx:Button click="fred(event)" />
    </mx:Application>

  • Programmatically create objects and formulas in Crystal Reports XI Developer edition?

    <p>Is it possible to programatically/dynamically create a text, line, formula field object, etc. in Crystal XI Developer edition?  I have been programming with the Crystal .Net reports component that came with VS 2005 for the past 6 months and know for a fact you can&#39;t programmatically create those objects although you can programmatically control their properties.  My intention is to create a dynamic report that can be reused extensively.  My current work-around for this was to create a generic report with about 40 formula field objects which draws data from 40 corresponding formula fields that I can programmatically set it&#39;s formula thus imitating a report field.  I want to update to the developer edition because I heard with this edition we can programmatically create and manipulate these objects but I found no reference or examples anywhere that proves we can do this?  Does anyone know for a fact or point me to the right place to look for documentation?  TIA</p>

    Hi,
    How can I programmatically refresh list of values status on CR server XI R2?
    Currently, after I modified the data source in the data connection, some of the LOVs in the report prompt window became empty when I tried to generate the report. I have to use Business View Manager to log onto the Crystal reports server XI R2, find and double click the list of values object to bring up the Edit LOV window, and then click on "Refresh Status" button to make the LOV available in the report prompt window.
    What SDK should I use to create a simple application (preferable a desktop application) to find all LOV objects on CR server XI R2 and to refresh their status? That is an application similar to the "Refresh Status" function in Business View Manager.
    I found Report Engine SDK has the Lov.Refresh function to refresh LOV. On the other hand, Report Engine SDK seems to be for BusinessObjects Enterprise, not for Crystal Reports Server. Can this or other function achieve what I want, i.e. to refresh list of values status on CR server XI R2? If yes, can I use it to develop a self-contained desktop application instead of a web application? I only need to run this application after I modify the data source in the data connection, so I prefer not need to deploy it as a web service.
    Thanks for your help.
    C.T.

  • How to create a dynamic table region with dynamic VO in processFormRequest

    Hi All,
    I have a requirement to create a dynamic table region with a dynamic VO.
    I need this because at runtime only the user will select the table name. So based on that table name, i have to create a table region to display the records.
    I already created a dynamic VO. Could anyone share the code for dynamic table region creation.
    Thanks in Advance.
    Thanks and Regards,
    Myvizhi
    Edited by: Myvizhi Selvi on May 20, 2013 6:21 PM

    Hi,
    You can use following sample code to create advance table columns dynamically with colum groups as well.
    It assumes that you have already created advance table with ID EmpTblRN.
    Below code returns column heading dynamically and if you keep your VO column names and attributes
    same in all the cases (COL1, COL2.....) then you can easily use a loop to create advance table columns.
    It is attaching VO attributes to OAMessageStyledText bean in the last.
    Hope it helps.
    OAAdvancedTableBean advTable = (OAAdvancedTableBean)webBean.findChildRecursive("EmpTblRN");
    Serializable [] param = {currentWindowSeq.toString()};
    Datum[] colHeadingArray = (Datum[])am.invokeMethod("getColumnHeading", param);
    String oldGrpName = null;
    String newGrpName = null;
    OAColumnGroupBean columnGroup = null;
    DictionaryData columnFormat = new DictionaryData();
    columnFormat.put(WIDTH_KEY, "4%");
    for (int i = 0; i < colHeadingArray.length; i++)
    try
    oracle.sql.STRUCT os = (oracle.sql.STRUCT)colHeadingArray;
    Object[] colHeadAttr = os.getAttributes();
    newGrpName = (String)colHeadAttr[0];
    if(newGrpName!=null)
    if(!newGrpName.equals(oldGrpName))
    // Create a column group, create the set the column header,
    // and add the column group under the advanced table
    columnGroup = (OAColumnGroupBean)createWebBean(pageContext, COLUMN_GROUP_BEAN, null, "ColGroup"+i);
    OASortableHeaderBean columnGroupHeader = (OASortableHeaderBean)createWebBean(pageContext, SORTABLE_HEADER_BEAN, null, "ColGroupHeader"+i);
    columnGroupHeader.setText(newGrpName);
    // Retrieve from message dictionary
    columnGroup.setColumnHeader(columnGroupHeader);
    advTable.addIndexedChild(columnGroup);
    oldGrpName = newGrpName;
    // Create a column, create the set the column header, and add the column
    // under the column group
    OAColumnBean column1 = (OAColumnBean)createWebBean(pageContext, COLUMN_BEAN, null, "Column"+i);
    OASortableHeaderBean column1Header = (OASortableHeaderBean)createWebBean(pageContext, SORTABLE_HEADER_BEAN, null, "Column1Header"+i);
    column1Header.setText(colHeadAttr[1].toString());
    column1.setColumnHeader(column1Header);
    column1.setColumnFormat(columnFormat);
    columnGroup.addIndexedChild(column1);
    // Create the actual leaf item under the first column
    OAMessageStyledTextBean leaf1 = (OAMessageStyledTextBean)createWebBean(pageContext, MESSAGE_STYLED_TEXT_BEAN, null, "Leaf"+i);
    //OARawTextBean leaf1 = (OARawTextBean)createWebBean(pageContext, RAW_TEXT_BEAN, null, "Leaf"+i);
    leaf1.setViewAttributeName("Week"+(i+1));
    String destination = "OA.jsp?page=/xxqc/oracle/apps/per/leaveadvance/webui/EmployeeLeaveDetailPG&personId={@PersonId}";
    destination = destination + "&startDate="+colHeadAttr[1].toString()+"-"+(String)colHeadAttr[0];
    destination = destination + "&addBreadCrumb=Y&retainAM=Y";
    leaf1.setDestination(destination);
    OADataBoundValueViewObject cssjob = new OADataBoundValueViewObject(leaf1,"Color"+(i+1));
    //leaf1.setAttributeValue(oracle.cabo.ui.UIConstants.STYLE_CLASS_ATTR, cssjob);
    leaf1.setAttributeValue(UIConstants.RENDERED_ATTR, cssjob);
    column1.addIndexedChild(leaf1);
    catch(Exception e)
    System.out.println("e"+e);

  • How to create object by getting class name as input

    hi
    i need to create object for the existing classes by getting class name as input from the user at run time.
    how can i do it.
    for exapmle ExpnEvaluation is a class, i will get this class name as input and store it in a string
    String classname = "ExpnEvaluation";
    now how can i create object for the class ExpnEvaluation by using the string classname in which the class name is storted
    Thanks in advance

    i think we have to cast it, can u help me how to cast
    the obj to the classname that i get as inputThat's exactly the point why you shouldn't be doing this. You can't have a dynamic cast at compile time already. It doesn't make sense. Which is also the reason why class.forName().newInstance() is a very nice but also often very useless tool, unless the classes loaded all share a mutual interface.

Maybe you are looking for

  • How can I pass in continuous value from labview to teststand?

    Hello I want to run a vi using teststand. I want this vi to send values to teststand. My problem is that the value is only updated at the end of the vi execution and I want to get the value before the end of the vi execution. If somebody can help me

  • Portal runtime error: Cannot access bean property

    Dear all, Does anybody have a clue what problem might couse the <b>Portal Runtime Error</b> described below? It does seem to occur when a second user wants to access the <b>Component</b>. <b>Portal Runtime Error</b> An exception occurred while proces

  • How to force Tiger to print doc within Classic environment, not with OSX?

    I want to print certain documents using OS9's printing utility within the Classic environment, and NOT using Tiger's standard OSX printing method. How? I know it is possible because I have two Macs connected to the same printer, and it works on one a

  • Random speeds, nowhere near ip profile.

    As the title says we're getting completely random speeds, mainly at peak time, but not always. We could either get 8mb or a decent 65mb. I've called support 3 times in total, first 2 times were apparently a fault at the exchange that were "sorted" lo

  • How to update Material group code in contracts ?

    Hi, We implemented SAP in my company a year ago. AS you can imagine we need to do some cleaning now we know how it works... We have change the Material Group code for over 1100 items. Thing is, the material group code in the contracts do not update a