Accessing Array of Structures from Coldfusion

I am having a problem accessing an array of structures from
Coldfusion within my flex application. Here is how I make my Array:
(GetRegions is a type Query and Type is a string variable)
<cfset ReturnArray = ArrayNew(1)>
<cfset ReturnArray[1] = StructNew()>
<cfset ReturnArray[1].Query = GetRegions>
<cfset ReturnArray[2] = Type>
Within flex I am trying to access the results in the
following way:
private function dataHandler(event:ResultEvent):void{
Query_Filter = new ArrayCollection(event.result[0].QUERY as
Array);
myString = event.result[1] as String;
Can anybody help me with this. I want a way to return a query
and a string back from coldfusion.
Thanks for the help,
Jeff

So now I changed my code to the following in CF:
<cfset Type = "MyString">
<cfset ReturnArray = ArrayNew(1)>
<cfset ReturnArray[1] = StructNew()>
<!--- set up query GetRegions --->
<cfset ReturnArray[1] = GetRegions>
<cfset ReturnArray[2] = Type>
<!--- Return Array --->
<cfreturn ReturnArray>
Now in flex I have the following dataHandler Function:
Alert.show("hello: "+ObjectUtil.toString(event.result[0]));
Query_Filter = new ArrayCollection(event.result as Array);
Now I set up a List box with Query_Filter as the dataprovider
but the results aren't showing correctly. The first item in the
list box is displayed as [object, Object], [object, Object] and the
second item is my String.
Does anybody know how to break up the query to a variable and
the string to its own variable in the dataHandler function.
Thanks for any and all help

Similar Messages

  • Access deep structures from tableView model binding

    Hi,
    I have a problem with accessing a deep structure component from a tableView control.
    The structure is defined like this:
    structure project_data
        main_data type structure
        data_table1 type table
        data_table2 type table
    end structure
    The deep structure project_data is an attribute of my model class.
    When I have a table attribute, it can directly be accessed by using table="//model/table_data" in the tableView.
    What do I have to write in my table attribute to access the deep structure directly via model binding.
    table="//model/project_data.table_data" doesn't work, it throws a bsp exception.
    Thanks in advance!

    So there is no direct way of doing this?
    But why does it work for textEdits like this: value="//model/project_data.main_data-description"
    What would I have to do in the interface methods to get it work, or is it simpler to just add the elements of the deep structure directly to my model class?

  • How do I access array elements in one method from another method?

    Hi all!
    How do I access the array's elements from another method so that method 2 can have access to method 1's array elements? Thanks for any help!
    I am trying to create a simply program that will use a method to create an array and a SEPARATE method that will sort the array's elements (without using java's built in array features). I can create the program by simply having one method and sorting the array within that same method, BUT I want to sort the array from another method.
    Here's my code so far:
    public class ArraySort {
       public static void createArray(int size){
           double myArray[] = new double[size];    //create my new array
           for(int j=0; j < myArray.length; j++)
              myArray[j] = (200.0 * Math.random() + 1.0);   //fill the array with random numbers
       public static void sortArray(){
           // I WANT THIS METHOD TO ACCESS THE ARRAY ELEMENTS IN THE METHOD ABOVE, BUT DON'T KNOW
          //  HOW???? Please help!
        public static void main(String[] args) {
            createArray(4);    //call to create the array
    }Thanks again!
    - Johnny

    Thanks for the help all! I ve managed to get the program working, using java's built in array sort, but when i try to call on the array sort method from WITHIN my main method, nothing happens!
    Can somebody please tell me why I am not able to call on the sort method from within my main class???? Thanks!
    public class ArraySort {
       public void createArray(double[] arrayName, int size){
           double myArray[] = new double[size];  //create new array
           for(int j=0; j < myArray.length; j++)
              myArray[j] = (200.0 * Math.random() + 1.0);    //populate array with
           }                                                 //random Numbers
           sortArray(myArray); 
       } //Sort array(if I delete this & try to use it in Main method --> doesn't work???
       public void sortArray(double[] arrayName){
           DecimalFormat time = new DecimalFormat("0.00");
           Arrays.sort(arrayName);      //sort array using Java's built in array method
           for(int i = 0; i <arrayName.length; i++)
               System.out.println(time.format(arrayName)); //print arary elements
    public static void main(String[] args) {
    ArraySort newArray = new ArraySort(); //create a new instance
    double myArray[] = new double[0]; //create a new double array
    newArray.createArray(myArray,4); //build the array of indicated size
    //newArray.sortArray(myArray); //This will not work???? WHY?????//

  • How to  access the ORACLE APPS table structures from SAP

    Hi Experts,
        How to  access the ORACLE APPS table structures from SAP? Is it possible from SAP?
    Thanks in advance
    Thomas

    Hi Silviya,
    you can access this database using a technique called DB Multiconnect - sometimes written as multi-connect.
    Search the SAP documentation and notes for this term and you will find how to do it.
    Essentially you configure the remote database connection via transaction DBCON.
    If your SAP system is not running on Oracle you will need to install the db-specific kernel files for Oracle along with the Oracel db client software - SQL*Net.
    Then you can access the Oracle database from ABAP using native-SQL. It works a treat!
    Cheers
    Graham Robbo

  • Passing array of structures back to java from c

    I have a DLL in C that I'm calling from a Java servlet. The C DLL creates a bunch of arrays of structures that I would like to be able to bring back to the Java servlet and process further. How difficult is this and does anyone have anywhere to point me that shows how it can be done?

    1. In general, java knows nothing about structures. So you have to define eqquivalent java classes, and write code to move the data from C structs into the classes.
    2. JNI supports definition of arrays of objects, which can be passed back from the dll.
    You may find some code generators that will help you with the
    CStruct->JavaObject definition. This may be a blind alley, but check out JACE.

  • Access af:table values from JavaScript array (for google maps task)

    Hi!
    I have JSP page with af:table where latitude and longitude for google maps are stored. I am using these tutorial [https://blogs.oracle.com/middleware/entry/integrating_google_maps_with_adf] and I know how to access latitude and longitude from output text (for one point). Now i need to do something similar with loop for all table rows. How can I achieve this?
    I have JavaScript code which uses Google Maps API and can display many points on one map. Also I have longitude and latitude data in af:table (bindings), each table row has one point. My task is to take data from af:table and pass it to JavaScript.
    May be it is better to use managed bean as you said. Firstly I will access binding data from managed bean. Then I have to pass this data to JavaScript method? Can you suggest some example? I have "Using JavaScript in ADF Faces Rich Client Applications"

    My table is there :
    <af:table value="#{bindings.LocView1.collectionModel}" var="row"
                                  rows="#{bindings.LocView1.rangeSize}"
                                  emptyText="#{bindings.LocView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                                  fetchSize="#{bindings.LocView1.rangeSize}" rowBandingInterval="0"
                                  filterModel="#{bindings.LocView1Query.queryDescriptor}"
                                  queryListener="#{bindings.LocView1Query.processQuery}" filterVisible="true" varStatus="vs"
                                  selectedRowKeys="#{bindings.LocView1.collectionModel.selectedRow}"
                                  selectionListener="#{bindings.LocView1.collectionModel.makeCurrent}" rowSelection="single"
                                  id="t1">
                            <af:column sortProperty="#{bindings.LocView1.hints.SoffOffCode.name}" filterable="true"
                                       sortable="true" headerText="#{bindings.LocView1.hints.SoffOffCode.label}" id="c1">
                                <af:outputText value="#{row.SoffOffCode}" clientComponent="true" id="ot1"/>
                            </af:column>
                            <af:column sortProperty="#{bindings.LocView1.hints.SoffCode.name}" filterable="true"
                                       sortable="true" headerText="#{bindings.LocView1.hints.SoffCode.label}" id="c2">
                                <af:outputText value="#{row.SoffCode}" id="ot2"/>
                            </af:column>
                            <af:column sortProperty="#{bindings.LocView1.hints.SoffLat.name}" filterable="true"
                                       sortable="true" headerText="#{bindings.LocView1.hints.SoffLat.label}" id="c3">
                                <af:outputText value="#{row.SoffLat}" clientComponent="true" id="ot3"/>
                            </af:column>
                            <af:column clientComponent="true" sortProperty="#{bindings.LocView1.hints.SoffLng.name}" filterable="true"
                                       sortable="true" headerText="#{bindings.LocView1.hints.SoffLng.label}" id="c4">
                                <af:outputText value="#{row.SoffLng}" clientComponent="true" id="ot4"/>
                            </af:column>
                            <af:column sortProperty="#{bindings.LocView1.hints.SoffZoom.name}" filterable="true"
                                       sortable="true" headerText="#{bindings.LocView1.hints.SoffZoom.label}" id="c5">
                                <af:outputText value="#{row.SoffZoom}" id="ot5"/>
                            </af:column>
                        </af:table>
    Javascript code:
    alert(document.getElementById("t1"));
    Result:
    [object HTMLDivElement];
    And
    alert(document.getElementById("t1").innerHTML);
    Result:
    <div id="t1::ch" style="overflow: hidden; position: relative; width: 366px;" _afrcolcount="5" class="xzg"><table class="xzi" summary="This table contains column headers corresponding to the data body table below" id="t1::ch::t" style="position:relative;table-layout:fixed;width:525px" cellspacing="0"><tbody><tr><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th><th style="padding:0px;padding-left:5px;width:100px;"></th></tr><tr><th _d_index="0" _afrfiltercol="true" class="xzr" align="left" nowrap="nowrap"><span id="t1:_afrFltrc1" class="x1u"><input id="t1:_afrFltrc1::content" name="t1:_afrFltrc1" class="x25" type="text"></span></th><th _d_index="1" _afrfiltercol="true" class="xzr" align="left" nowrap="nowrap"><span id="t1:_afrFltrc2" class="x1u"><input id="t1:_afrFltrc2::content" name="t1:_afrFltrc2" class="x25" type="text"></span></th><th _d_index="2" _afrfiltercol="true" class="xzr" align="left" nowrap="nowrap"><span id="t1:_afrFltrc3" class="x1u"><input id="t1:_afrFltrc3::content" name="t1:_afrFltrc3" class="x25" type="text"></span></th><th _d_index="3" _afrfiltercol="true" class="xzr" align="left" nowrap="nowrap"><span id="t1:_afrFltrc4" class="x1u"><input id="t1:_afrFltrc4::content" name="t1:_afrFltrc4" class="x25" type="text"></span></th><th _d_index="4" _afrfiltercol="true" class="xzr" align="left" nowrap="nowrap"><span id="t1:_afrFltrc5" class="x1u"><input id="t1:_afrFltrc5::content" name="t1:_afrFltrc5" class="x25" type="text"></span></th></tr><tr><th id="t1:c1" _d_index="0" _afrleaf="true" _afrroot="true" class="xzj" align="left"><div style="position:relative; float:right"><table id="t1:c1::afrSI" _afrhoverable="true" style="display:none" class="x104" cellpadding="0" cellspacing="0"><tbody><tr><td _afrsortasc="1"><a tabindex="-1" class="xzm" title="Sort Ascending"></a></td><td _afrsortdesc="1"><a tabindex="-1" class="xzn" title="Sort Descending"></a></td></tr></tbody></table></div><div class="x19p">SoffOffCode</div></th><th id="t1:c2" _d_index="1" _afrleaf="true" _afrroot="true" class="xzj" align="left"><div style="position:relative; float:right"><table id="t1:c2::afrSI" _afrhoverable="true" style="display:none" class="x104" cellpadding="0" cellspacing="0"><tbody><tr><td _afrsortasc="1"><a tabindex="-1" class="xzm" title="Sort Ascending"></a></td><td _afrsortdesc="1"><a tabindex="-1" class="xzn" title="Sort Descending"></a></td></tr></tbody></table></div><div class="x19p">SoffCode</div></th><th id="t1:c3" _d_index="2" _afrleaf="true" _afrroot="true" class="xzj" align="left"><div style="position:relative; float:right"><table id="t1:c3::afrSI" _afrhoverable="true" style="display:none" class="x104" cellpadding="0" cellspacing="0"><tbody><tr><td _afrsortasc="1"><a tabindex="-1" class="xzm" title="Sort Ascending"></a></td><td _afrsortdesc="1"><a tabindex="-1" class="xzn" title="Sort Descending"></a></td></tr></tbody></table></div><div class="x19p">SoffLat</div></th><th id="t1:c4" _d_index="3" _afrleaf="true" _afrroot="true" class="xzj" align="left"><div style="position:relative; float:right"><table id="t1:c4::afrSI" _afrhoverable="true" style="display:none" class="x104" cellpadding="0" cellspacing="0"><tbody><tr><td _afrsortasc="1"><a tabindex="-1" class="xzm" title="Sort Ascending"></a></td><td _afrsortdesc="1"><a tabindex="-1" class="xzn" title="Sort Descending"></a></td></tr></tbody></table></div><div class="x19p">SoffLng</div></th><th id="t1:c5" _d_index="4" _afrleaf="true" _afrroot="true" class="xzj" align="left"><div style="position:relative; float:right"><table id="t1:c5::afrSI" _afrhoverable="true" style="display:none" class="x104" cellpadding="0" cellspacing="0"><tbody><tr><td _afrsortasc="1"><a tabindex="-1" class="xzm" title="Sort Ascending"></a></td><td _afrsortdesc="1"><a tabindex="-1" class="xzn" title="Sort Descending"></a></td></tr></tbody></table></div><div class="x19p">SoffZoom</div></th></tr></tbody></table></div><div id="t1::db" class="xz9" style="position: relative; width: 366px; overflow: hidden; height: 521px; z-index: 1;" _afrcolcount="5"><table class="xza x102" style="table-layout:fixed;position:relative;width:525px;" _totalwidth="525" _selstate="{'0':true}" _rowcount="179" _startrow="0" cellspacing="0"><tbody><tr _afrrk="0" class="xzy p_AFSelected"><td style="width:100px;" class="xzv" nowrap="nowrap"><span id="t1:0:ot1">26</span></td><td style="width:100px;" class="xzv" nowrap="nowrap">01</td><td style="width:100px;" class="xzv" nowrap="nowrap"><span id="t1:0:ot3">47.90782714384932</span></td><td style="width:100px;" class="xzv" nowrap="nowrap"><span id="t1:0:ot4">106.88643654861448</span></td><td style="width:100px;" class="xzv" nowrap="nowrap">15</td></tr><tr _afrrk="1" class="xzy"><td class="xzv" nowrap="nowrap"><span id="t1:1:ot1">26</span></td><td class="xzv" nowrap="nowrap">02</td><td class="xzv" nowrap="nowrap"><span id="t1:1:ot3">47.91542113773543</span></td><td class="xzv" nowrap="nowrap"><span id="t1:1:ot4">106.88540658035276</span></td><td class="xzv" nowrap="nowrap">15</td></tr><tr _afrrk="2" class="xzy"><td class="xzv" nowrap="nowrap"><span id="t1:2:ot1">26</span></td><td class="xzv" nowrap="nowrap">03</td><td class="xzv" nowrap="nowrap"><span id="t1:2:ot3">47.90768330745696</span></td><td class="xzv" nowrap="nowrap"><span id="t1:2:ot4">106.89544877090452</span></td><td class="xzv" nowrap="nowrap">15</td></tr><tr _afrrk="3" class="xzy"><td class="xzv" nowrap="nowrap"><span id="t1:3:ot1">26</span></td><td class="xzv" nowrap="nowrap">04</td><td class="xzv" nowrap="nowrap"><span id="t1:3:ot3">47.90716549312801</span></td><td class="xzv" nowrap="nowrap"><span id="t1:3:ot4">106.86879834213255</span></td><td class="xzv" nowrap="nowrap">14</td></tr><tr _afrrk="4" class="xzy"><td class="xzv" nowrap="nowrap"><span id="t1:4:ot1">26</span></td><td class="xzv" nowrap="nowrap">05</td><td class="xzv" nowrap="nowrap"><span id="t1:4:ot3">47.89841940184846</span></td><td class="xzv" nowrap="nowrap"><span id="t1:4:ot4">106.82674130477903</span></td><td class="xzv" nowrap="nowrap">13</td></tr><tr _afrrk="5" class="xzy"><td class="xzv" nowrap="nowrap"><span id="t1:5:ot1">26</span></td><td class="xzv" nowrap="nowrap">06</td><td class="xzv
    .etc
    Javascript:  alert(document.getElementById("t1:121:ot3").innerHTML); this retrieve in value
    But only 50 rows in this result. I have many rows. How I can get all???

  • How to access a JSON structure key that starts with a number

    I've got an odd issue here.  I'm accessing someone else's JSON structure so I am not able to change it.  The JSON structure keys are named with both characters and numbers like this:
    0
    198456
    product_id
    198456
    1
    Rashaan Houston feat Tony Loreto
    artist
    Rashaan Houston feat Tony Loreto
    So, in other words, there's a key named "0" and a key named "product_id", both of which contain the same key.  Why they did that, I don't know, but they did.
    In one of the instances, the data stored under the text-named key isn't the same as the numerical-named key.  I tried to output the data in the numerical key like this (it's an array of structures):
    #strStompyJSON.data[1].0#
    but I get the following error:
    Invalid CFML construct found on line 41 at column 31.
    ColdFusion was looking at the following text:
    .0
    When I do the following, it works fine:
    #strStompyJSON.data[1].product_id#
    So it looks as though CF doesn't like accessing a variable that starts with a number.  I am able to loop through the structure using a collection loop, and it outputs all of the keys (including the numerical ones) and their values using the following code:
    <cfloop collection="#strStompyJSON.data[1]#" item="key">
    #key#: #strStompyJSON.data[1][key]#<br />
    </cfloop>
    However, that doesn't allow me a way to access specific keys named with a number.  Is there a way that I can specifically access a key that is named with a number?
    thanks!
    Mike

    No problem--glad it worked out.
    As a follow-up to this, I'd encourage you to keep the bracket notation in mind during future development.  It is EXTREMELY useful in a lot of situations.
    For example, if you're building a structure on the fly with dynamic keys, bracket notation is extremely helpful:
         <cfset authors = structnew()>
         <cfloop list="authorlist" index="name">
              <cfset authors[name] = getbooklist(name)>
         </cfloop>
    Also, bracket notation is really nice when creating json from ColdFusion structures.  Consider this:
         <cfset author = structnew()>
         <cfset author.name = "Neil Gaiman">
         <cfset author.genre = "Fantasy">
         <cfset author.awesome = true>
         <cfset authorjson = serializejson(author)>
    By default, the serialized json produced will have all UPPER CASE keys.  Not a big deal in most cases, but if you're returning the json to something (like a JS library) that is expecting keys in a certain case, it can be a problem.  Fortunately, bracket notation allows you to specify exactly what case you want the structure's keys to be in:
         <cfset author = structnew()>
         <cfset author['name'] = "Neil Gaiman">
         <cfset author['Genre'] = "Fantasy">
         <cfset author['AWESOME'] = true>
         <cfset authorjson = serializejson(author)>

  • Passing an array of structures to an Oracle stored procedure (CFMX)

    I'm looking to write a Oracle stored procedure where I would pass in an array of structures and loop over each iteration to insert the bits and pieces within the structures to the DB.,
    I haven't written this type of procedure / package before.  I am planning to do an sp / package similar to what is sketched out in the second reply to this thread: http://forums.oracle.com/forums/thread.jspa?threadID=1078772
    Assuming I do, how can I call the procedure from ColdFusion (I'm using MX) and pass in my array?  As far as I can see, none of the CF_SQL_Types make sense.

    Let me know if you make any progress.  I'm fighting the same battle.  What I've done so far is to convert my array of struct into a delimited CLOB that looks like this:
    prop1;prop2;prop3|prop1;prop2;prop3|prop1;prop2;prop3|prop1;prop2;prop3|
    Then I wrote a stored proc to suck it up using a pipelined function.  It's not to bad but parsing the CLOB on the ORACLE side is somewhat time consuming.
    I've also converted the array to XML and used dbms_xmlstore to convert but, on large arrays, it is very slow and the CLOB gets huge fast.
    I was hoping to use the cf_sql_refcursor but I can't figure out how.
    Warren

  • Loops in arrays or structures

    Loops in arrays or structures
    I was given a project on html reports and
    They have advised me to use Loops in arrays or structures
    At this point I am a novice at this html reporting system. I
    would like to know how I can use loops in arrays or structures.
    How is it beneficial are
    1. Structures
    2. Arrays
    3. loops in for both
    for my reports.
    Countless thanks in advance

    Structures are great if you understand them, they are
    basically just arrays organized by keywords rather than index
    numbers.
    Arrays are very nice, as you can just run through loops to
    access each element, as they are all indexed by numbers 0-x.
    loops are great to navigate through both. All you have to do
    is set an loop to run through x amount of iterations of the array
    or structure (where x is the length of the array, or number of
    elements in the structure). Loops are great due to the small amount
    of code they require.

  • Question re Accessing catalogues and files from an external hard drive in Elements 6.

    Having just acquired an ehd, I have successfully carried out a trial back up of an Elements 6 2000 picture catalogue from an XP based PC, using the Elements 6 full back-up process. This process is intended to be used eventually to transfer this and other catalogues onto a new Windows 8 PC installed with Elements 11.
    However, in the interim I would also like to be able to access the picture files and the catalogue data on the ehd from a Vista based laptop which also has Elements 6 installed. Can you please advise how to do this without carrying out a full restore process that would load all of the files onto my laptop's hard drive.
    In transferring the picture files to the ehd I also seem to have lost the original file structure that was on my PC, as folders have been renamed numerically and are all held individually in the main folder of the ehd. Whilst this doesn't matter too much whilst the files remain on the ehd, provided the catalogue still knows where to find them, has the original file structure been permanently lost, or can I recreate it when I eventually restore the files and catalogue on the new Windows 8 PC?
    I'm anxious to get this process right as I have a much larger catalogue to similarly back-up and transfer, once I have acquired the new PC, and was hoping to be able to similarly access this catalogue by my laptop from the ehd as there is insufficent hard disk space on my laptop to hold all the 20,000 files involved.
    Please help
    Gardener 179

    Thanks for your help re my original questions. 
    Reassured regarding not having lost the file structure of my pictures, and bearing in mind the relatively small catalogue I had backed up, I thought that rather than restoring by leaving the picture files on the EHD, I would after all restore to the laptop hard drive, as a trial run before dealing with my main catalogue. 
    The restore was successful but raised a number of further issues that I would appreciate your advice on:-
    1) The original catalogue name was not used in the restoration process. The restored catalogue on the laptop has simply been named "Pictures". Is this normal and if I now rename the restored catalogue will this create problems with any subsequent supplementary backups of the catalogue?
    2) In restoring the catalogue I heeded the Adobe Help and specified the Vista folder C:\Users\Maurice\Pictures as the location for the picture files rather than simply restoring the original XP folder structure. However, since I also wanted to retain the lower level folder structure of my XP files (which are basically date files) I then specified to "Retain the Original Folder Structure". This has resulted in the full XP folder structure being created within \Pictures on the laptop.
    Is it possible to avoid this situation occurring, or will I have to remove the unwanted XP sub-folder structure from the laptop and reconnect the thumbnails in the Photoshop catalogue to the new file locations? Also if I have to move files in this way will I once again have problems with any subsequent restorations of the same catalogue?
    I have also a couple of supplementary questions re the initial backup to the EHD which I have now looked at more closely:-
    1) The original XP catalogue has 1853 picture files, (and this is identical to that subsequently restored on the laptop), yet in backing up the catalogue to the EHD it seems that in excess of 2200 picture files have been created. Why is this?
    2) As previously advised the pictures are held on the EHD numbered sequentially as "b000001" etc, and due to my selecting the EHD top level root folder as the destination for the back up are held in F:\. Should I have created a new folder, say "Backup 1" on the EHD, and then specified this as the destination folder, as I am concerned that on backing up further catalogues the existing picture files will get overwritten and the Photoshop Backup and Catalogue files confused with previous backups? If so can I move the existing back up files to a new folder now without causing any problems?
    Finally could you confirm what would have happened to the folder structure on the EHD had I carried out the Restore process by locating the picture files on the EHD but retaining their original file structure. Would the picture files have been copied into their original file structure for use by the restored catalogue and the duplicate backup files left unaltered, or would the backup picture files have been replaced by the restored file structure? Also would the "catalogue file" be transferred to the Laptop C:\ drive in this process or would this also stay on the EHD and be accessed from there by Photoshop?
    Sorry for all the questions but I really want to fully understand what is going on before risking doing anything to move my main catalogue.
    Regards

  • 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

  • Idoc Structure From Flat FIle

    Hi,
    I have two queries.
    1.I need to import idoc structure from excel file not from sap, is it possible ?
    2 what are the detalied steps to implement following SAP note for getting processed file name at runtime.
    Thanks & Regards
    Tuhin
    Symptom
    You want to access the name of a file sent through a File Adapter Sender channel from a custom developed XI module.
    Other terms
    XI 3.0, XI30, File Adapter, Module Processor, Module Development, Modules
    Reason and Prerequisites
    The functionality described in this note requires SP 9 or higher of the component XI ADAPTER FRAMEWORK CORE 3.0.
    Solution
    The File Adapter passes the name of the processed file to the module processor. This information is available in a Hashtable object accessible as as supplemental module data under the name "module.parameters" within the module's 'process' method.
    For further information, please take a look at the example code below:
    public ModuleData process(ModuleContext mc, ModuleData md) throws
      ModuleException
      Hashtable mp       = (Hashtable)
                             md.getSupplementalData("module.parameters");
      String    fileName = null;
      if (mp != null)
        fileName = (String) mp.get("FileName");

    Hi Tuhin,
    <i>
    1. .I need to import idoc structure from excel file not from sap, is it possible ?</i>
    Yes and No; If the structure in the Excel sheet is defined  in XSD format (XML schema) then it should be possible to import it assuming you are using XI 3.0. In 2.0 this is not possible.
    Not sure if in XI 3.0 you are allowed to import Excel files straight forward into XI.
    <i>2 what are the detalied steps to implement following SAP note for getting processed file name at runtime.</i>
    I'm not quite sure but this looks to me like you have to implement this within a Java custom function/mapping...
    The data (in this case the filename) is encapsulated in a Hashtable object available during runtime.
    Cheers,
    Rob.

  • How to pass an array or structure, in addition to a query, or multiple queries to the Report Builder as parameters

    Is there a way to pass an array or structure for example as parameters, in addition to a query, or multiple queries to the Report Builder in CF8? I believe this was recommended by users to be in CF8.

    BrianO,
    Although it's been a while, I thought I'd provide the code to do this for you. It works for me in CF8, and probably will in CF7.
    Here I create a structure called My, and provide that one parameter to my CFReportParam tag.
    <CFSet My = {
    Client = "Client Name",
    ReportDateFrom = DateFormat(ThisStartDate, DateMask),
    ReportDateTo = DateFormat(ThisEndDate, DateMask),
    PageHeaderImage = ImagePath & "\Logos\Page_Header.png",
    WatermarkImage = ImagePath & "\Logos\Watermark.png",
    GetBarSummary = GetBarSummary,
    GetPieSummary = GetPieSummary
    }>
    <CFReport Template="#ReportPath#\SpendSummary.cfr" Format="PDF" Query="GetSummary">
    <CFReportParam Name="My" Value="#My#">
    </CFReport>
    Inside the report itself, reference the given parameter as Param.My.PageHeaderImage for example. It can be referenced that way from any expression inside the report builder. You can even use the queries as the data source for charts (using the Data From a Query -> Query Builder -> Advanced) by entering "Param.My.GetPieSummary" where it says "Variable containing query object".
    HTH
    Swift

  • How to pass a structure/array of structure as input parameter in a webservice

    Hi Team,
    I am trying to create a webservice in powerbuilder .net( pb 12.5.1) . As this webservice will be used by external world to access some of data on basis of some input paarameter.
    So can i use array of structure as input parameter to a webservice ? If no, then how can i pass a result set ( mora then 1 row with more than one column)
    as an argument to the webservice.
    Regards
    Subrat

    I am assuming this is the same for .Net but in Classic you can create NVO's with Instance Variables and then reference them in the NVO that will be used as the parameter for the Public WebService.
    WS NVO's:
    Children
         String             Child[]
    Customer
         String             FirstName
         String             LastName
         String             DOB
         Children          Children
    Public Interface uses Customer
    Calling Code Example:
    integer    rc, liNdx
    string     lsReturn
    SoapConnection lSoapConnect
    proxy_testing  px_Testing
    lSoapConnect = CREATE SoapConnection
    if IsValid(lSoapConnect) then
    TRY
      rc = lSoapConnect.CreateInstance(px_Testing, 'proxy_testing')
      CHOOSE CASE rc
       CASE 100
        lsReturn = "Invalid proxy name"
       CASE 101
        lsReturn = "Failed to create proxy"
       CASE 0
        Proxy_Customer lNewCustomer
        lNewCustomer = CREATE Proxy_Customer
        lNewCustomer.FirstName = 'Chris'
        lNewCustomer.LastName = 'Craft'
        lNewCustomer.DOB = 'Getting Older'
        Proxy_Children lChildren
        lChildren = CREATE Proxy_Children
        lChildren.Child[1] = 'Madeline'
        lChildren.Child[2] = 'Hayden'
        lNewCustomer.Children = lChildren
        lsReturn = px_Testing.NewCustomer(lNewCustomer)
       CASE ELSE
        lsReturn = "Unknown error (" + String(rc) + ")"
      END CHOOSE
      if rc <> 0 then MessageBox("Invocation Error", lsReturn, Exclamation!)
    CATCH (RuntimeError rte)
      rc = -1
      MessageBox("Runtime Error", rte.text, Exclamation!)
    END TRY
    end if
    Chris Craft

  • OOABAP-How to access the protected methos from a class

    How to access the protected methos from a class..There is a built in class..For tht class i have created a object..
    Built in class name : CL_GUI_TEXTEDIT
    method : LIMIT_TEXT.
    How to access this..help me with code

    hi,
    If inheritance is used properly, it provides a significantly better structure, as common components only
    need to be stored once centrally (in the superclass) and are then automatically available to subclasses.
    Subclasses also profit immediately from changes (although the changes can also render them invalid!).
    Inheritance provides very strong links between the superclass and the subclass. The subclass must
    possess detailed knowledge of the implementation of the superclass, particularly for redefinition, but also in
    order to use inherited components.
    Even if, technically, the superclass does not know its subclasses, the
    subclass often makes additional requirements of the superclass, for example, because a subclass needs
    certain protected components or because implementation details in the superclass need to be changed in
    the subclass in order to redefine methods.
    The basic reason is that the developer of a (super)class cannot
    normally predict all the requirements that subclasses will later need to make of the superclass.
    Inheritance provides an extension of the visibility concept: there are protected components. The visibility of
    these components lies between that of the public components (visible to all users, all subclasses, and the class itself), and private (visible only to the class itself). Protected components are visible to and can be used by all subclasses and the class itself.
    Subclasses cannot access the private components  particularly attributes) of the superclass. Private
    components are genuinely private. This is particularly important if a (super)class needs to make local
    enhancements to handle errors: it can use private components to do this without knowing or invalidating
    subclasses.
    Create your class inse24 and inherit this CL_GUI_TEXTEDIT
    class in yours. You can then access the protected methods.
    Hope this is helpful, <REMOVED BY MODERATOR>
    Edited by: Runal Singh on Feb 8, 2008 1:08 PM
    Edited by: Alvaro Tejada Galindo on Feb 19, 2008 2:19 PM

Maybe you are looking for

  • Windows 7 Bootcamp 3.1 No Sound

    Having a strange issue with a Windows 7 64 install on a 27" iMac (i5). I've installed Bootcamp 3.1, fixed the terrible banding issue that generally plagues me every time I do one of these 27" Bootcamp installs, and (for the very first time, having do

  • Visited the house next door. Got kicked out when I offered a gift

    I'm not the first and  I won't be the last.  I just got lured into it. Others have described this problem online in much less temperate language than I intend to use. I am Applescripting away in InDesign, minding my own business, when it strikes me t

  • "Compiler error. Report this problem to NI." LV7.0

    I get the error "Compiler error. Report this problem to NI; nmx unbundler bad sea/eea or edisp-sdisp=0x4". I generated a test vi, where you can reproduce the error. The error happens, when saving or running the vi. This kind of error is happening in

  • Cross Platform Organization App?

    Throughout the day I sometimes come across things that I want to remember for later such as websites, thoughts, pictures, etc. I'm looking for a way to put these things in one place that I can access from a windows machine at work, my mac at home, an

  • Magic Mouse Bluetooth and MacBOOK Pro problems

    Hello, In the past few days, I noticed the BT Magic Mouse started stuttering as if it was low on batteries or too far from the MacBook Pro (not a Mac Pro) I checked the batteries, they are at 100%, I am using the same mouse pad as I ever did and the