Changing content in an array

can someone help me with changing content in an array. The index will be specified by the user entering the index number.
eg
Enter the item number to Change
1
Then I need to replace the data in this index with new data.
I am very new to java so I am sorry if this seems like a stupid questions. Your help is much appreciated.
thanks

public void modifyIt(String[] myArray){
  System.out.println("Which index?");
    int index = readResponse() //read in response somehow
  System.out.println("Whats the new data?");
  String data = readResponse() // read in response
  myArray[index] = data;
}

Similar Messages

  • How can I update a Site Column with the content of an array with javascript CSOM?

    I'm relative new to Sharepoint 2013, I'm trying to update the content of a Site column with the content of an array, I can retrieve and visualize the content of my site column, the user is able to change and save the necessary part and the changes are
    saved into an array, now I have to update the content of the site column with the content of the array, but for some kind of reasons I can't accomplish that, any suggestion/example? This is my code so far to retrieve, visualize the site column and store the
    mofication into my array.
        <body>
                <select id="dropdown" name="dropdown" onchange="optSelect()">
                    <option value="EngineType_Cylinders">EngineType_Cylinders</option>
                    <option value="EngineType_EngineCycle">EngineType_EngineCycle</option>
                    <option value="EngineType_EngineFamily">EngineType_EngineFamily</option>
                    <option value="EngineType_Euro">EngineType_Euro</option>
                    <option value="EngineType_FamilyEvolution">EngineType_FamilyEvolution</option>
                    <option value="EngineType_GasEmissionLevel">EngineType_GasEmissionLevel</option>
                    <option value="EngineType_Power">EngineType_Power</option>
                    <option value="EngineType_PowerSupply">EngineType_PowerSupply</option>
                    <option value="EngineType_Use">EngineType_Use</option>
                </select><br />
                <textarea id="textareadisplay" rows="25" cols="23"></textarea><br />
                <input type ="button" value="Update values" onclick="addItemsToColumns()" />
            </body>
    My Javascript
        $(function () {
            SP.SOD.executeOrDelayUntilScriptLoaded(Function.createDelegate(this, function () {
               var select = document.getElementById('dropdown').value;
                console.log(select);
                getSiteColumns(select);
            }), 'SP.js');
        var fieldChoice;
        var choices;
        var addFields = [];
        var slc;
        var clientContext;
        function optSelect() {
            slc = document.getElementById('dropdown').value;
            getSiteColumns(slc);
        function getSiteColumns(selection) {
           clientContext = SP.ClientContext.get_current();
            if (clientContext != undefined && clientContext != null) {
                var web = clientContext.get_web();
                fieldChoice = clientContext.castTo(web.get_availableFields().getByTitle(selection), SP.FieldChoice);
                clientContext.load(this.fieldChoice);
                clientContext.executeQueryAsync(Function.createDelegate(this, this.OnLoadSuccess), Function.createDelegate(this, this.OnLoadFailed));
        function OnLoadSuccess(sender, args) {
            choices = fieldChoice.get_choices();
            var textarea = document.getElementById("textareadisplay");
            textarea.value = choices.join("\n");
        function OnLoadFailed(sender, args) {
            alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
        function addItemsToColumns() {
            clientC = SP.ClientContext.get_current();
            var arrayForUpdate = $('#textareadisplay').val().split('\n');
            fieldChoice.set_item(, arrayForUpdate);
            fieldChoice.update();
            clientContext.executeQueryAsync(function () { }, function () { });
        function OnUpdateSuccess(sender, args) {
            var newchoices = fieldChoice.get_choices();
    My problem is on the function addItemsToColumns() please help! Thanks in advance.

    Let's look at your stylesheet -
    <style type="text/css">
    body {
    background-image: url(assets/images/Business%20Men%20In%20Reception%20Col.2.jpg);
    background-repeat: no-repeat;
    background-color: #003;
    margin-left:auto;
    margin-right:auto;
    position: relative;
    width: 960px;
    It's a good idea not to use spaces or any punctuation in your filenames when working for the web.
    #header {
    margin-left:auto;
    margin-right:auto;
    position: relative;
    width: 960px;
    #heading {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 36px;
    font-style: italic;
    font-variant: normal;
    margin-left:auto;
    margin-right:auto;
    There's no need to specify the default values (font-variant:normal) or to specify auto margins for any block element without an explicitly defined width. And wouldn't it make more sense to put the font style on the body tag, where it will inherit into the rest of the page than to restate it as you have done in the next rule?
    #bodytext {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 18px;
    line-height: 25px;
    font-variant: normal;
    width: 300px;
    #container {
    width: 960px;
    position: relative;
    margin-left:auto;
    margin-right:auto;
    .rightimg {
    float: right;
    margin-left: auto;
    padding-right: 40px;
    #heading #navbar ul li {
    padding: 30px;
    </style>
    Margin-left:auto can't work without knowing what the width of the element is....  Keep your CSS lean and targeted - it will help you to debug your layouts.

  • Displaying the contents of an array of objects

    Hello All,
    My Java teacher gave us a challenge and I'm stumped. The teacher wants us to display the contents of the array in the main menthod. The original code is as follows:
    public class TestObjects
         public static void main ( String args[] )
              Thing[] thingArray = { new Thing(4), new Thing(7) };
    }I understand that the elements of the array are objects, and each one has a value assigned to it. The following code was my first attempt at a solution:
    public class TestObjects
         public static void main ( String args[] )
              Thing[] thingArray = { new Thing(4), new Thing(7) };
                                    for ( int i = 0; i < thingArray.length; i++)
                                       System.out.println( thingArray );                         
    }To which I'm given what amounts to garbage output. I learned from reading about that output that its basically displaying the memory location of the array, and the the contents of the array. There was mention of overriding or bypassing a method in System.out.println, but I don't believe that we're that far advanced yet. Any thoughts? I know I have to get at the data fields in the objects of the array, but i'm not having an easy time figuring it out. Thanks very much in advance!

    robrom78 wrote:
    public class TestObjects
         public static void main ( String args[] )
              Thing[] thingArray = { new Thing(4), new Thing(7) };
    for ( int i = 0; i < thingArray.length; i++)
    System.out.println( thingArray );                         
    Note that you're trying to print the entire array at every loop iteration. That's probably not what you meant to do.
    You probably meant to do something more like
                                 System.out.println( thingArray[i] );Also, note that the java.util.Arrays class has a toString method that might be useful.
    To which I'm given what amounts to garbage output. It's not garbage. It's the default output to toString() for arrays, which is in fact the toString() defined for java.lang.Object (and inherited by arrays).
    I learned from reading about that output that its basically displaying the memory location of the array, and the the contents of the array.It displays a default result that is vaguely related to the memory, but probably shouldn't be thought of us such. Think of it as identifying the type of object, and a value that differentiates it from other objects of the same type.
    By the way I assume you mean "+not+ the contents of the array" above. If so, that is correct.
    There was mention of overriding or bypassing a method in System.out.println, but I don't believe that we're that far advanced yet. Any thoughts? No, you don't override a method in println; actually methods don't contain other methods directly. You probably do need to override toString in Thing.
    I know I have to get at the data fields in the objects of the array, but i'm not having an easy time figuring it out. You can get to the individual objects in the array just by dereferencing it, as I showed you above.
    But I suspect that won't be sufficient. Most likely, Thing doesn't have a toString method defined. This means that you'll end up with very similar output, but it will say "Thing" instead of "[Thing" and the numbers to the right of the "@" will be different.
    You'll need to override the toString() method in Thing to get the output you want.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to change content-type in receiver mail adapter

    Hi,
    I have receiver mail adapter for sending XML file as attachment in the mail. My partner expects to receive mail with content-type: text/xml, but XI sends Content-Type: application/xml. Please advise how I can change content-type to text/xml.
    Thank you
    Lev

    hi,
    try MessageTransformBean
    Transform.ContentType
    http://help.sap.com/saphelp_nw04/helpdata/en/57/0b2c4142aef623e10000000a155106/content.htm
    also shown in my blog:
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Change content-disposition in email attachment

    I am using apex_mail (in Apex 4.1) to send emails with an attachment.
    v_mail_id := apex_mail.send(
             p_to  => '[email protected]'
             ...etc...
    apex_mail.add_attachment( p_mail_id    => v_mail_id
                             ,p_attachment => v_image
                             ,p_filename   => 'signature.jpg'
                             ,p_mime_type  => 'image/jpeg');
    Apex creates this as an attachment:
    Content-Disposition: attachment;
    I would like to change it to inline:
    Content-Disposition: inline;
    so I can reference it in my email body with <img src="cid:signature.jpg"/>. Well... I hope it is going to be shown inline anyway if I change Content-Disposition.
    Currently (with Content-Disposition: attachment;) it works for Outlook, but, for instance, not in Gmail in the browser. Gmail shows the image separately as an attachment.
    Is there a way to change the content-disposition with Apex?
    I know it is possible to do it with utl_mail, but this is currently not installed in our databases. I need to involve our DBA to set this up, and I don't know if he is willing to do that.

    Hi Joel,
    I thought so. I will put this in the Apex feature request database.
    Ino
    BTW, for other people it might be interesting to know that there is another option I tried that doesn't work in many situations either. You can put this in the email body:
    <img src="data:image/jpeg;base64,'||v_image_base64||'"/>
    where v_image_base64 is the base64 encoded jpg image.
    From my experiments the inline attachment with a cid reference seems to work best.

  • How to change Content-Transfer-Encoding for mail sending

    Hello Experts,
    I need to send some documents through mail which i am doing with the help of cl_output_service=>document_output method. Mail is been send succesfully.
    But in the payload content which got from Exchange server:
       X-Mailer: SAP Web Application Server 7.10
       Content-Type: text/plain;
        charset="us-ascii"
       Content-Transfer-Encoding: quoted-printable
    Can any one help me, how i can change Content-Transfer-Encoding field to some other format which is not  'quoted-printable'.
    Thanks & Regards,
    Dheeraj

    Do you documents contain an XML Declaration like this at the top?
    <?xml version="1.0" encoding="ISO-8859-2"?>
    If not, then they need to. The XML 1.0 specification says that if an XML declaration is not present, the processor must default to assume its in UTF-8 encoding.

  • How to change content type from Document set to Item

    While creating content type I've selected Item as a parent but after created I can see its showing Document Set as a parent content type. Now can anyone please suggest if possible I can change the parent content type from Document Set to Item.

    Hi,
    From your description, I know you want to change content type’s parent after creating it.
    There is no OOB method to change content type’s parent after you create it. If current content type has not been used, you could delete it and recreate it with your desired base type. Here are similar cases:
    http://sharepoint.stackexchange.com/questions/16131/change-base-content-type-of-content-type
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/b976f17e-99b5-42bb-bc82-8d4123a625cf/change-the-parent-of-a-content-type.
    This article may help you understand the relationship of Content type inheritance:
    https://support.office.com/en-au/article/Create-and-edit-content-types-3d5d45af-608d-4183-8d51-073095fe0312#__toc239159103.
    Best Regards
    Vincent Han
    TechNet Community Support

  • How to change contents of PDF

    Hello,
    I want to know is there any way by which i can change content of pdf.
    please tell me

    thanks..
    I have done that. using iText it is helpfull.
    Still there is a bit of problem.
    When I open the file adobe pdf is unable to open the file .
    where are foxyplayer can view it correctly with edited content so please can you
    show me possible changes to do so.

  • Event Structure's value change, not detecting changes when tabbing thru array of clusters

    Hi!  I have an array of clusters (int, int, string, int) control, and want to detecting changes made to the it.  I used the Event Structure's value change case on the array, it works excellent except that it'll only detect the changes when you click out of the element or press the enter key (the one by the numbers, not carriage return).  I want it to detect the changes when I tab thru the cluster or array too, but I can't figure it out... Does anyone have any ideas?
    Thanks!

    mfitzsimons wrote:
    altenbach
    Tried Value Change with my example done in 7.1 and it doesn't trgger an event.  That is why I suggested Mouse Down.
    Curious. I did a few minor edits in 8.0 before saving as 7.1, but the simple value change event got triggered just fine when the value vas terminated with a tab in 7.1. Every time.  Strange....
    Are you on 7.1 or 7.1.1? Maybe there's a difference (I am using 7.1.1).
    LabVIEW Champion . Do more with less code and in less time .

  • Loosing changed contents when used FM REUSE_ALV_GRID_DISPLAY

    Hi,
    I have used FM REUSE_ALV_GRID_DISPLAY in my program as below.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = g_repid
          i_callback_pf_status_set = c_pf
          i_callback_user_command  = 'USER_COMMAND'
          is_layout                = ist_layout      "I_CALLBACK_TOP_OF_PAGE = C_TOP
          it_fieldcat              = ist_fieldcat
        TABLES
          t_outtab                 = ist_outtab.
    and kept one column editable by setting EDIT = 'X' and INPUT = 'X' for one column in ist_fieldcat.
    Now if user changes contents of a cell in this editable column and clicks on any toolbar button, then changed contetns are not received in USER_COMMAND routine.
    But if user changes the contents of a cell in this editable column and then double-clicks anywhere inside the ALV grid, then changed contents are received in USER_COMMAND routine.
    I dont want to loose the changed contents of ALV grid, can anybody help in this.
    Thanks in advance.
    Regards,
    Dhiraj

    In your USER_COMMAND form check the SY-UCOMM  for button which you have pressed may be you have used '&IC1'  (for double click)
    provide your Form USER_COMMAND code here.
    Kanagaraja L

  • Unable to change content types for pptx, xslx and docx files

    I'm running into an issue where I cannot change the content type of any xml-based Office documents. Here's what I've done:
    1 - Create a custom content (A) type based off the Document content type
    2 - Enable the custom content type in a document library
    3 - Add a document or select an existing document and edit the content type to the custom content type
    4 - The custom content type will save for documents such as .ppt, .doc, etc. The custom content type will now save for .docx, .pptx or .xlsx files. The properties window will save without displaying any errors but the content type will not change
    I ran several tests including creating another custom content type (B) based off of the Document content type. I proved that:
    The custom content type (B) can be saved to .docx, .pptx or .xlsx files IF no additional columns are added to the custom content type
    As soon as I add a column to the custom content type the aforementioned documents cannot be saved as that custom content type 
    Documents created through the File option in a document library also fail to change content type to the custom content type when saved. Most of my files are .docx, .pptx, or .xlsx files, and this issue poses a significant roadblock in our SharePoint roll-out.
    I appreciate any advise you can provide.

    Hi,
    According to your post, my understanding is that the custom content type could not save with .docx, pptx and xlsx files when with a additional column.
    I tested with your issue as the steps below, the custom content type worked well.
    Create a custom column Doc1
    Create a custom content type Doc1, the parent content type from chose the Document Content Types, Parent Content Type chose Document.
    Add the custom Doc1 to the custom content type Doc1.
    Add the custom content type into the library LIbA.
    Upload the files with .docx, .pptx and .xlsx files into the library with the custom content type, they all save well with the custom content type.
    I also create other content type with other Parent Content Type, they all worked.
    Did the issue occur in other library? You can create a new library then use the custom content type to check whether it works.
    You can also use the other browsers to check whether it works, such as Chrome, Firefox.
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Re: Is it possible to change row colors on array fields ors

    HI Martin!
    Yes, it is possible to change row colors on array fields.
    I have attached a PEX (tools.pex) which has an object which changes FillColor
    and PenColor for Arrays. The PEX has it's own test window, so you can try
    various combinations. (There are a few other Objects in the Project which are
    not relevant
    I'm not sure that you can change colors on individual choices in a scroll list.
    I haven't tried playing around with it.
    The test window actually changes the color of scroll lists as well.
    The object keeps track of which rows have changed color, same with pen color, so
    that when you scroll it keeps track of which rows are a different colors.
    The pex is self-contained, just import the file and do a test run.
    Please let me know if you have any problems.
    -later
    -labeaux
    Is it possible to change row colors on array fields or scroll lists?
    I need to create a list field that will allow me to dynamically change the
    fillColor and/or penColor attributes of individual rows. (I just want to
    highlight the rows, and those seem to be the obvious attributes...) It appears
    you can't do that on scroll lists (the elements are list elements, and don't
    have those attributes) and I can't figure out how to do it on an array field
    either. Any ideas for how to accomplish this?
    -Martin ([email protected])

    FreshWebmuse,
    Version 2 of iCal has the "Group Calendar" feature. It was released as part of Mac OS X v10.4, and if you really want/need that feature you will have to upgrade to Tiger.
    ;~)

  • How to change content of DataGrid cell on mouse over

    I am trying to change content of a datagrid cell when the mouse is over it. Changing the dataProvider does not provide immediate feedback because update is performed by renderer. I am trying to directly update content of a cell onMouseOver and restore it onMouseOut.
    I am thinking of leaving the column empty and insert content onMouseOver, cleanup onMouseOut. Alternative, may be I can populate the column and mask out all but the cell the mouse is over.
    Any suggestion on how this may be done?
    Thanks!

    I would override updateDisplayList, call isItemHighlighted and set the content of the cell accordingly
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • How to change Content canvas size during run time?

    Hi All,
    I am using oracle 10g web forms and opening in Separate Frame. When I re-size the MID window, I want to change Content canvas size to window size. Is it possible to change content canvas size at run time? Even after using following statement it is not working.
    set_canvas_property('content_can', WIDTH, 200 );
    set_canvas_property('content_can', HEIGHT, 100 );
    Please help me.
    Regrads

    Francois,
    Yes, I have used messages, when get the current values (after setting new values) it shows right one but on the screen it is not accurate because
    it is going beyond the window size and it adding scroll bars. I am using window W&H minus some numbers. When I look at the help it says size in characters. How to set the Content canvas size in characters?
    Is it possible to change the Content Canvas size in Run time? Please help me.
    Regards.

  • Change content in adobe forms of Print Preview in Appointment screen

    Hi ,
    I have a requirement in which I have to change content of adobe forms which comes after clicking on Print Preview in Appointment screen,
    I am new to Smart forms and Adobe forms , request expert suggestion onto this.
    Thanks.

    Try opening in Chrome or Firefox and inspecting the elements. You can turn easily locate the CSS that's driving the background and experiment with settings. You get there by right clicking on an element and select Inspect Element from the options. It's much easier than trying to go through all of that HTML code without a style sheet to go along with it.

Maybe you are looking for