Access to ResultList objects from Labview user interface

Hi!
I would like to have access to TS Locals.ResultList[] objects from user interface (LV) after test report is generated.
According to TS Help in this point I can get sequence context for the process model sequence file which posts UIMsg_ModelState_PostProcessingComplete message.
But objects of my interest are located in context of client sequence file.
Can I get access to Locals.ResultList objects with use provided model file context?
Are there another ways to get wanted data?
I have references to sequence file and execution in this point and tried to use Execution.RunTimeVariables property.
But could not get wanted data with any supposed lookup string from this object.
Thanks in advance for any ideas.
Solved!
Go to Solution.

The general idea is the following:
You have to keep in mind that Locals.ResultList on the model level (callstack) is simply the return value of a sequence call step (MainSequence). Therefore, you will only have this single entry [0].
To get access to the results of the steps inside you MainSequence (and any other sublevel in the callstack), you have to dig into this callstack using this "root-property":
Locals.ResultList[0].TS.SequenceCall.ResultList
hope this helps,
Norbert
[EDIT]: Since i have not stated it: The screenshot displays the UIMessageEvent callback function in a simple oi where the manager control is the Application Manager.
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.

Similar Messages

  • Imlementing synchronized access to shared objects in LabVIEW OOP

    Many objects in object-oriented programming have an
    identity, such as a file, a front-panel object or a hardware device.
    These objects cannot be modelled using present LabVOOP (LabVIEW Object Oriented Programming) objects as
    LabVOOP objects gets copied as wire is branched; multiple different
    wires cannot all represent a single object. This issue has been
    irritating the community of LabVIEW users since the release of LabVOOP
    a few months ago.
    It seems that there is a huge demand for
    objects with unique identity i.e. by-reference objects in LabVIEW. The
    central problem why LabVOOP propably doen't have these objects is the
    difficulty in implementing synchronized access to these objects from
    multiple parallel threads. The problem of synchronized access can be
    divided into two different separate topics. First how the
    sychronization should be implemented in LabVIEW runtime engine. Second
    how this synchronization mechanism should be visible to the developer.
    I'd like to start this thread to discuss these two issues.
    Synhronization under the hood
    Traditionally
    people talk about locking of an object and about get-modify-set pass
    when accessing the object. Locking is traditionally done by acquiring a
    mutex for an object, modifying the object and releasing the mutex so
    that other threads can access the same object instance. This is how
    inter-thread synchronization is traditionally done. However, besides
    the mutex based locking, the computer science community has innovated
    also different kinds of methods on synchronizing the access to objects.
    One way to get object-level synchronization is modify the
    runtime engine so that it only allows a single method of a synchronized
    object to run at any time. This mechanism of syncrhonization is
    implemented in programming languages like O'Haskell, which is a Haskell
    variant with object orirented features.
    Also different
    transactional mechanisms[1,2] have been successful. In transactional
    mechanisms multiple threads are allowed to access a synchronized object
    simultaneously. As each method accessing an object commits their
    changes, they verify that no other object has modified the object
    simultaneously in a manner than would break the transaction. If such a
    modification has occurred, everything is rolled back. Transactional
    mechanism do not suit to every possible situation as not everything can
    be rolled back. For example it's hard to roll back an action that
    somehow modifies the physical world.
    User experience of synchronization
    How
    the synchronization is generally implemented in LabVIEW shouldn't be
    directly visible to the developer end-user. The developer should
    understand the general concepts of synchronization to take full
    advantage of it, but in general the synhronization mechanism should be
    integrated directly to development environment. There should in general
    be no need to acquire a mutex by calling acquire mutex node but instead
    the end-user should be able to specify which data needs synhronized
    access in more sophisticated way.
    In the following I propose a
    mechanism of integrating the synchronized access of by-ref objects to
    the development environemnt of LabVIEW. The proposal is very
    preliminary but I hope it breaks the ice and the community would start
    innovating in how should NI implement the syncrhonization support in
    the user interface of LabVIEW.
    Wire level synchronization
    Only
    methods can access object private data members. In synchronized access
    to the object, it's the methods accessing the private data members that
    need to be synchronized. The private data members are accessed by
    applying unbundle node to the class wire and data is written back to
    the object using bundle node.
    What I propose is the following.
    An unbundle node could either be normal or "synchronized". A
    synchronized unbundle would guarantee the access to the private data
    members in synchronized manner. All data wires originating from
    synchronized unbundle would be of synchronized type, in a little
    similar manner as a dynamic dispatch wire is of special dynamic
    dispatch type. Such a wire must evetually be connected to a bundle
    node. When the wire is bundled back to the originating object, the
    synchronization requirement is released.
    These synchronized
    wires would look somewhat different from normal wires so that the
    developer instantly knows that the wire is synchronized. The developer
    can branch the wire, but only one wire branch can own the synchronized
    type. The developer could easily select which wire would be
    syncrhonized by Ctrl+clicking the wire. Such a wire can be considered
    as a combination of a data and a mutex, even though mutexes don't need
    to be the underlying synchronization method. The wire just guarantees
    that there is a mechanism in the runtime engine that makes sure the
    access to the wire data is synchronized.
    There is a need to wire
    data originating from a non-synchronized wire to a synchronized wire so
    that it can replace the private data member of the class. This is
    accomplished with a new node similar to bundle node, that would allow
    replacing the data in a syncrhonized wire with some data originating
    from a non-synchronized wire.
    The synchronized wire can be
    connected to a front panel controls of special syncrhonized type. This
    way the synchronized wire can originate from a method and allow passing
    the synchronized data to the calling VI and back to another method.
    This is practical for example in a situation when the developer wants
    to run different analyzes to a data class but don't want to rewrite all
    the existing data analysis tools as class members. So the developers
    writes a syncrhonization acquiring getData method that let's the
    calling VI to access the syncrhonized data. Then the developer passes
    this data to an analysis VI and passes the result back to a setData
    method that writes the result back to the class wire.
    There
    will probably be technical problems in allowing the user to connect
    such a synchronized wire to all existing VIs since these VIs. Therefore
    the programming model for all nodes that do not support such
    synchronized wires will be branching the wire and passing the
    non-synchronized wire branch to the node and then bundling the result
    back to the synchronized wire.
    To increase performance and
    decrease unnecessary buffer copies when a syncrhonized wire is
    branched, if the syncrhonized wire continues directly to the new bundle
    synchronized wire node, no buffer copy is made.
    Discussion
    The
    syncrhonized access to a by-ref LabVOOP objects can be implemented in
    multiple ways by National Instruments. The synchronized access should
    be divided to two different and independent parts: 1) the user
    experience of synchronization and 2) the runtime engine synchronization
    mechanisms. As LabVOOP objects have special properties compared to
    other LabVIEW data types, optimal user experience can be gained by
    designing the user experience specifically for LabVOOP objects. From
    user experience point-of-view this syncrhonization mechanism may not
    work for other data types. Separating object syncrhonization from
    synchronization of other data types is advantageous also for other
    reasons. Due to the fact that object data can only be accessed via
    object methods, more advanced synchronization methods may be used with
    objects than can be used with other data types. O'Haskell
    synchronization implementation is an example of this. Integrating the
    synchronization directly to the user interface allows NI to change the
    mehcanisms under the hood, when computer science comes up with more
    advanced methods. Therefore NI could begin with traditional and quite
    easy mutex-based synchronization and later move to more advanced
    perhaps transaction based syncrhonization methods or even combinations
    of multiple different methods.
    I hope this topic generates
    discussion that would help NI to implement an excellent synchronization
    mechanism in LabVOOP. I hope that all talented individuals in the
    community participate this discussion to help NI to reach this goal. I
    also hope that if you just have time, it would be great if you could
    surf the computer science resources to find out what kinds of new
    techniques there exists for synchronizing access to shared resources. A
    Large community may find much more innovative solutions than a few engineers at NI. Let's give NI the power of open source design
    Tomi Maila

    Hello Tomi,
    First, thank you for taking the time to write such a well
    though-out suggestion.  Are you familiar
    with the “LabVIEW Object-Oriented Programming: The Decisions Behind the Design”
    document?  I think the reason we chose to implement a ‘by
    value’ strategy, is that is more in line with the LabVIEW programming paradigm
    of dataflow, and would make sense to most of our LabVIEW users.
    I think your suggestion is interesting, and it does
    highlight the need to think outside of the conventional LabVIEW box and look to
    some of the innovative things other languages do.  However, I think we all agree that
    synchronization takes careful planning and extra work for the programmer.  Even with an ‘ideal’ solution I see no way
    around this.  For LabVIEW users today,
    one great way to get synchronized ‘by reference’ semantics with your objects is
    to use a single-element queue to pass your object.  The queue itself is passed ‘by reference’ and
    is inherently synchronized!  The does
    have the disadvantage of adding one more small layer of complexity to your
    program, but some complexity would have to be introduced in any situation.  The other disadvantage with this is that it
    is not always an intuitive way to implement your program and requires some
    amount of LabVIEW knowledge before one would generally come across this
    technique.
    In any case, I appreciate the time and effort you put in to
    your suggestion.  Please make sure that
    you submit the suggestion formally through the NI Product Suggestion Center so
    that it can be reviewed by some of the decision makers here.
    Thanks again,
    Travis M
    LabVIEW R&D
    National Instruments

  • How to get the value of the global variable of test stand in labview User interface?

    Hi.
     Can anyone Please share examples and tell me to how access the test stand global variable using labview user interface.
    Solved!
    Go to Solution.

    I'm not surprised that what you are doing doesn't work.  The Start Execution UI Message is triggered when the user clicks a button to start an execution.  Realize that most executions go through a process model.  So you could be looking at the sequence context of the process model and not your client sequence file.
    I recommend reading that link I posted above.  UI Messages are your best bet but you cannot just piggy back on an existing UI Message like this.  They may not be getting sent at the time you need them to be.  The only way to ensure you get what you want is to trigger one yourself at the right time.
    Regards,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • How can we import object from 1 user to another user using DATA PUMP

    hi,
    i have taken full export by EXPDP( data pump) now i want to import user objects from target user of one database to another user of different database.
    plz reply me solution
    Thanks

    Hi,
    impdp 'user/user@db' DIRECTORY=DATA_PUMP_DIR(DEFAULT) DUMPFILE=FILENAME.dmp LOGFILE=IMPORT.LOG REMAP_SCHEMA=SOURCE SCHEMA:TArget SCHEMA
    1.Before Import check whether user importing has read,write on directory.
    2.Always Try to Add logfile clause This will help.
    3.Add TABLE_EXISTS_ACTION=REPLACE if you want target schema tables to be replaced by source schema table(if both has same table)
    Regards,
    NEerav

  • I want to copy all the objects from one user to another... Please help

    Hii Experts.... I have a problem here. Please give me solution for this...
    I am using Oracle 11g on my windows XP system.
    I created a new user named "some"
    I want to copy all the objects from scott user to some user... Please help me
    Please Explain me in detailed way
    Thank you

    SowmyRaj wrote:
    Hii Experts.... I have a problem here. Please give me solution for this...
    I am using Oracle 11g on my windows XP system.
    I created a new user named "some"
    I want to copy all the objects from scott user to some user... Please help me
    If all what you are interested is Scott schema than no need to use the datapump or CTAS. Run demobld.sql in your schema and it would have all the objects of Scott.
    http://www.oracle.com/technology/sample_code/tech/sql_plus/htdocs/demobld.html
    HTH
    Aman....

  • Nwdi-managed access of pcd-objects from java web dynpro

    Hi,
    im am trying to access portal pcd-objects from a java web dynpro component (namely getting and setting personalized iview properties). for locally managed web dynpro components this works fine with the code below.
    when i try the same with a nwdi managed web dynpro component i run into problems regarding references to used dcs. for instance, i need to reference used dc SAP_JTECHS/tc/epbc/pcm/adminapi/java because the build needs tcepbcpcmadminapijava.jar which is inside the mentioned dc. but access permissions of this dc don't allow the dependency. when i try to "add used dc ..." in nwds i get the error message: illegal dependency: access list does not allow use of ...
    has someone any solution for this problem? are there other ways of accessing pcd-objects from java web dynpro (nwdi managed!)?
    thanks
    heiko
    private static void savePersonalizationData(String value) {
         try {
              IAttributeSet attributeSet = (IAttributeSet) getIview(IVIEW);
              attributeSet.putAttribute(ATTRIBUTE, value);
              attributeSet.save();
         } catch (Exception e) {
    private static Object getIview(String pcdPath) throws Exception {
         Hashtable env = new Hashtable();
         env.put(
              com.sap.portal.directory.Constants.REQUESTED_ASPECT,
              com.sap.portal.pcm.admin.PcmConstants.ASPECT_SEMANTICS);
         env.put(
              Context.SECURITY_PRINCIPAL,
              WDClientUser.getCurrentUser().getSAPUser());
         env.put(
              IPcdContext.PCD_PERSONALIZATION_PRINCIPAL,
              WDClientUser.getCurrentUser().getSAPUser());
         InitialContext iCtx = new InitialContext(env);
         return iCtx.lookup(pcdPath);

    Hi Kust,
    To access the PCD objects the code you used looks ok for me but your main issues is related to the dc access permissions. This thread discussed about the similar issue. Please review this below thread.
    /message/979328#979328 [original link is broken]
    Regards
    Krishna Reddy

  • Help Importing objects from 1 user to another user and problem with trigger

    Hello community, i am having a little difficulty with the exporting objects from one user to another specifically the exporting of the trigger.
    Here is the situation, because of SOX purpose whenever a update is sent to the client the dba have to execute the script as himself (priviliged user) and is not allowed to log into the schema to make changes. Therefore we perpend the object definitions with &user_schema.. and they define user_schema in sqlplus and execute the update script.
    Here is a small example which requires two users (user1 and user2) with the following grants (connect, create table, create trigger, create view, create sequence). Please forgive the naming of the objects, just trying to be as simple as possible.
    I start out by logging in as system user via sqlplus and execute the following.
    ------------------Begin sqlplus----------------------
    define user_schema=user1;
    create table &user_schema..abc01 (
      col1 number,
      col2 varchar2(20),
      col3 number,
      constraint pk_abc01_col1 primary key (col1)
    create table &user_schema..xyz01 (
      col1 number,
      col2 varchar2(20),
      col3 number,
      constraint pk_xyz01_col1 primary key (col1)
    create or replace view &user_schema..view1 as
    select x.col1, x.col2, x.col3, a.col1 as acol1, a.col2 as acol2, a.col3 as acol3
    from xyz01 x
    inner join abc01 a on a.col1 = x.col1;
    create sequence &user_schema..seq_xyz01 start with 1 increment by 1;
    create or replace trigger &user_schema..trig01
    before insert on &user_schema..xyz01 for each row
    begin
      if (nvl(:new.col1, -1) = -1) then
        select seq_xyz01.nextval into :new.col1 from dual;
      end if;
    end;
    /--------------------End sqlplus----------------------
    I would then proceed to export using the exp utility via the command line
    exp system/systempassword file=user1.dmp owner=user1
    Then import user1 objects into user2
    imp system/systempassword file=user1.dmp fromuser=user1 touser=user2
    Now the problem:
    When i take a look at the sql for user2 trigger (trig01) i see the following (viewed via sqldeveloper)
    create or replace TRIGGER "USER2".trig01
    before insert on user1.xyz01 for each row
    begin
      if (nvl(:new.col1, -1) = -1) then
        select seq_xyz01.nextval into :new.col1 from dual;
      end if;
    end;its referring to user1.xyz01 table, however i want it to point to is user2.xyz01 table. Can someone please help me out or offer another solution to go about this because i need the ability to import the objects into a different user without the import failing and having to recompile the object.
    I've also tried executing this while connected as system user via sqlplus:
    define user_schema=user1
    create or replace trigger &user_schema..trig01
    before insert on xyz01 for each row
    begin
      if (nvl(:new.col1, -1) = -1) then
        select seq_xyz01.nextval into :new.col1 from dual;
      end if;
    end;
    /but that fails stating that table or view does not exist, please help
    however that fails because i
    Edited by: user3868150 on Nov 6, 2009 6:05 PM

    When performing an update in their system, the same script will be run with different values, thats not the problem.
    The client currently have just that one schema in their environment, however they want to have another instance of the application set up in their environment (same database) and have that go off on its own track separate from the original application.
    Now when we do an exp of the schema and the imp it into another user it get imported, however its incorrect. As stated before the trigger will be acting on the table in the original schema when it should be acting on the table in the newly imported schema.
    I suppose there is no other way around this when a trigger is created the way in which i outlined above. I guess after the data gets imported into a different user the trigger would have to be recompiled to point to the correct table.
    If you have an alternate solution to go about this i am open to suggestions. However like i mentioned in the original post because of SOX purpose the dba is not allowed to log in and execute update scripts as the schema user. The scripts should only be executed as that privileged user (dba).
    Also if i hard code the user when the trigger is created
    create or replace trigger user1.trig01
    before insert on user1.xyz01 for each row
    begin
    if (nvl(:new.col1, -1) = -1) then
    select seq_xyz01.nextval into :new.col1 from dual;
    end if;
    end;
    /it still doesn't get imported the way that i want it to be imported in user2
    create or replace TRIGGER "USER2".trig01
    before insert on user1.xyz01 for each row
    begin
      if (nvl(:new.col1, -1) = -1) then
        select seq_xyz01.nextval into :new.col1 from dual;
      end if;
    end;now when i do an insert to test
    insert into user1.xyz01 (col2, col3) values ('abc', 123); -- Works fine, no problems here
    insert into user2.xyz01 (col2, col3) values ('abc', 123);Results in an error ORA-01400: cannot insert NULL into ("USER2".XYZ01"."COL1") because the trigger doesn't exist on user2.xyz01 table.
    Just try and create the schema like how i outlined above in your environment to see what i'm talking about. It seems that the only way to get the trigger to be imported the way i want it to is to actually log in as that user and create the trigger.
    sqlplus user1/user1
    {code}
    create or replace trigger trig01
    before insert on xyz01 for each row
    begin
    if (nvl(:new.col1, -1) = -1) then
    select seq_xyz01.nextval into :new.col1 from dual;
    end if;
    end;
    {code}
    Edited by: user3868150 on Nov 6, 2009 6:10 PM

  • How to move database objects from one user to another user

    Could someone help how to move database objects from one user to another user
    Thanks in advance

    Thanks a lot for the reply.
    Actually I wanted to know whether there is any command to change the owner ship of the table.
    For ex table1 belongs to user1. can the owner of table1 to be changed to owner2.
    directly using an oracle command. I knew that it can be done using import and export, since the table was 200 million thought the rename command would be faster instead of import and export.
    Thanks Billy for letting me know that it is not possible using oracle query.

  • Accessing TS Watch view window in LabVIEW user interface?

    HI All
    I am trying to build TS user interface in LabVIEW. I want to give ability to user to debug sequence while running.(ability to put breakpoint and view the value of variables in watch view window).
    Can we access TS watch view window in LabVIEW .I did not find any activex control for it.
    If not how can you give user ability to debug sequence?
    Does anyone have idea about this?

    hi
    I have tried using that.Call stack gives you option to view current execution from the list of executions.(Call stack in TS basically).
    It does not give you watch view interface .
    Basically I want user to give option to debug sequence . So on the execution view control he should be able to put breakpoint and then once execution reaches breakpoint , he should be able tov view variables values by adding them in watch view pane.
    any ideas how to do this?

  • Reading the output values after each step executes in LabVIEW User Interface

    Hello all,
    Development environment: TestStand 2010 SP1 and LabVIEW 2010 SP1
    Problem: is there a way to execute the subsequent steps programatically and get the output values from each of them?
    I have already extended a little bit a Full OI interface for TestStand to load up any sequence, choose some of the steps and run them step by step (something like option to Run Selected steps). What I am trying to do is to add some actions between each step and do that in User Interface (I can't modify the sequence!), so I am starting the NewExecution with some previously configured InteractiveArgsParam and set an option breakAtFirstStep to True. Afterwards I am just doing something like Step Over when debugging the sequence and this works good, but I didn't fine a way yet to read the output values from the steps...
    Then, if I wait until the execution finishes I can read my Results by processing the ResultObject, but this works only after finalizing of the test sequence. Since I wanted to stop after each step, read the values, do some actions and continue to the next step I tried to register an event callback for Trace of Execution View Manager. I can see that after each executed step this event is triggered, but when I try to read a ResultObject returned in Event Data it is not filled with values (ResultList seems to be empty?). Is it a proper behaviour or maybe I am doing the readout in wrong way? (It is the same VI as for reading ResultObjects after sequence finishes and there it works fine for arrays, containers and other data types).
    Like I mentioned I can't modify the Test sequences, I can't add a UImessages.
    What are my options? Should the trace event returns all output values from each steps or is it just used for status checking? Or maybe there is completely different approach to that matter?
    Thanks in advance for any suggestions,
    Best Regards.
    CLA, CTD, CLED @ Test & Measurements Solutions Poland
    Solved!
    Go to Solution.

    Thanks for your replay, I have tried to build it in my LabView Block Diagramm, es seems like this image.
    But the variable GetNumSubProperties ist always 0. Why?
    PS: I need only the variable "Step.Result.PassFail" from the last step, do you know, how can I get it? I think, it is maybe easier than read all the "Result".
    Attachments:
    ReadStepResultInLabview.JPG ‏39 KB

  • Modifying sequence variables from Labwindows User Interface

    Hi,
    What is the correct procedure for modifying sequence variables from a
    LabWindows CVI user interface.
     I am currently using an enhanced version of the simple interface that is
    shipped with TestStand.
    I have tried SetValVariant etc. with a ref to the engine  and this didn't
    work for me.
    Should I first be passing the sequence context via PostUIMessageEx ?
    Thanks in advance,
    Bill
    Solved!
    Go to Solution.

    Hey Bill,
    Yeah, I forget that this process is a little bit more straightforward in LabVIEW then it is in CVI (just one type cast is necessary).  Here are the steps (and variables) to make it a usable SequenceContext object:
     LPUNKNOWN tempActiveXRef;
     VARIANT tempTSSeqContext;
     CAObjHandle TSSeqContext;
         //Get ActiveX object from UIMessage
       tsErrChk(TS_UIMessageGetActiveXData (uiMsg, NULL, &tempActiveXRef));
         //Convert LPUNKNOWN to Variant
       tempTSSeqContext = CA_VariantIUnknown (tempActiveXRef);
         //Convert variant to object handle
       CA_VariantConvertToType (&tempTSSeqContext, CAVT_OBJHANDLE, &TSSeqContext);
    tsErrChk(TS_PropertySetValString(TSSeqContext, &ErrorInfo, "MyLookup.String", 0, "Testing"))
    I haven't tested this exact code, but I modified some code that I know works for the purpose of demonstration.  Like I said, I wish there was a way to just type cast straight to the Object Handle, but since you are getting an LPUNKNOWN object, you have to first go the variant.  Have a good one.
    Adam

  • Get overall Pass/Fail from custom User Interface

    Hi Guys
    I’m working on a custom user interface for operators and I would like to check and display the overall Pass/Fail result of the test at certain time intervals during execution.
    I added a sequence called ‘GetOverallResult’ to the ‘FrontEndCallbacks.seq’ which checks the Pass/Fail status of the sequence and I’m calling it form a SubVI within the User Interface written in LabVIEW (Check status.vi).
    The problem is that I’m getting the Pass/Fail status of the CallBack sequence not the test sequence I’m running.
    Could anyone please help me in this?
    Attachments:
    Check status.vi ‏17 KB
    FrontEndCallbacks.seq ‏5 KB

    Hi Attila,
    Have you instead tried reading the value directly from the main sequence? Have a look at the attached VI; pass the sequence context in and the Get Property Value VI will read the sequence's state.
    Is this suitable for what you had in mind?
    Regards,
    Tom
    Applications Engineering, NI UK
    Attachments:
    check.vi ‏10 KB

  • Accessing the same object from multiple classes.

    For the life of me I can't workout how I can access things from classes that haven't created them.
    I don't want to have to use "new" multiple times in seperate classes as that would erase manipulated values.
    I want to be able to access and manipulate an array of objects from multiple classes without resetting the array object values. How do I create a new object then be able to use it from all classes rather than re-creating it?
    Also I need my GUI to recognize the changes my buttons are making to data and reload itself so they show up.
    All help is good help!
    regards,
    Luke Grainger

    As long as you have a headquarters it shouldn't be to painfull. You simply keep a refrence to your ShipDataBase and Arsenal and all your irrellevant stuff in Headquarters. So the start of your Headquarters class would look something like:
    public class Headquarters{
      public Arsenal arsenal;
      public ShipDatabase db;
    //constructor
      public Headquarters(){
        arsenal = new Arsenal(this, ....);
        db = new ShipDatabase(...);
    //The Arsenal class:
    public class Arsenal{
      public Headquarter hq;
      public Arsenal(Headquarter hq, ....){
        this.hq = hq;
        .Then in your ShipDatabase you should, as good programing goes, keep the arraylist as a private class variable, and then make simple public methods to access it. Methods like getShipList(), addToShipList(Ship ship)....
    So when you want to add a ship from arsenal you write:
    hq.db.addToShipList(ship);
    .Or you could of course use a more direct refrence:
    ShipDatabase db = hq.db;
    or even
    ShipList = hq.db.getShipList();
    but this requires that the shiplist in the DB is kept public....
    Hope it was comprehensive enough, and that I answered what you where wondering.
    Sjur
    PS: Initialise the array is what you do right here:
    //constructor
    shipList = new Ship[6];
    shipList[0] = new Ship("Sentry", 15, 10, "Scout");
    " " " "etc
    shipList[5] = new Ship("Sentry", 15, 10, "Scout");PPS: To make code snippets etc. more readable please read this article:
    http://forum.java.sun.com/faq.jsp#messageformat

  • Accessing an UIComponent object from a .java

    Hello,
    I have i new problem here, i have fetch in the java-doc but in vain ...
    Does somebody have an example on the syntax of the code that i have to put in my java file to access an UIComponent object ?
    Thanks :-)
    In fact here is what i'd like to do:
    I would like to have in my jsp, a select list with values defined in my backing bean according to a parameter. For example, a product can have 2 status: sold out or available. If available i want the select list to have values as 1,2 and if sold out 2,3 ...

    No in fact what i want is:
    I want a select list with 4 options:
    - Choice 1
    - Choice 2
    - Choice 3
    - Choice 4
    if the status is 1, then i want my select list to contain :
    - Choice 1
    - Choice 2
    In this case, i want to remove from my backing bean, the choice 3 and choice 4
    if the status is 2:
    - Choice 1
    - Choice 2
    - Choice 3
    So in this case, i want to remove choice 4...
    I need to do that from a bean.

  • Access PL/SQL Objects from JavaScript

    I have following Problem:
    I want to have access to a pl/sql object from javascript.
    for example:
    i have a procedure with a parameter called test from Type Test.
    PROCEDURE toTest (
    test Test)
    IS
    BEGIN
    htp.script('here i want the value of test', 'javascript');
    would be really great if somebody can help me fast.
    thanks a lot
    holger

    I think it might have something to do with htmldb_Get
    Hope that clue gets you somewhere. I would love to see a working example of this for 4.02 if anyone actually has one.
    Regarding dynamic actions there's a severe limit on the number of them I believe.29? Which is one reason I avoid them and
    just do things in javascript. Personally I think javascript is actually easier to understand because one does not have to
    divide an actiivity up into several pieces. But that might just be specific to my brain, I don't know.

Maybe you are looking for