How to properly change the content of text item object

Working in CS3 here.
I have a collection of text item objects from a grep search.
I want to iterate through the items and possibly change the values depending on a conditional statement.
So say I have a collection myTextObject that contains text item objects from a GREP search
<code>
for (var i = 0; i<myTextObject.length; i++) {
     if (myTextObject[i].content == "myCondition") {
          myTextObject[i].content = "My New Value";
</code>
Once I do that, all the other content values in my collection are one byte off. So I am guessing that when the collection is created, Indesign sets a byte limit on the collection and when content is replaced, it sets everything off.
I understand that the collection is built from the beginning of the document so possibly iterating backward would solve the problem?
Any other suggestions here?

yep. iterating backwards shoud help.

Similar Messages

  • How can i  change the column label text in a alv table display

    how can i change the column label text in a alv table display??
    A similar kinda of question was posted previuosly where the requirement was the label text was needed and following below code was given as solution :
    <i>*  declare column, settings, header object
    DATA: lr_column TYPE REF TO cl_salv_wd_column.
    DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    DATA: lr_column_header type ref to CL_SALV_WD_COLUMN_HEADER.
    get column by specifying column name.
    lr_column = lr_column_settings->get_column( 'COLUMN_NAME1' ).
    set Header Text as null
    lr_column_header = lr_column->get_header( ).
    lr_column_header->set_text( ' ' ).</i>
    My specific requirement is i have an input field on the screen and i want reflect that value as the column label for one of the column in the alv table. I have used he above code with slight modification in the MODIFYVIEW method of the view since it is a process after input. The component gets activated without any errors but while run time i get an error stating
    <i>"The following error text was processed in the system CDV : Access via 'NULL' object reference not possible."</i>
    i have checked in debugging and the error occured at the statement :
    <i>lr_column = lr_column_settings->get_column( 'CURRENT_YEAR' ).</i>Please can you provide me an alternative for my requirement or correct me if i have done it wrong.
    Thanks,
    Suri

    I found it myself how to do it. The error says that it is not able to find the reference object i.e  it is asking us to refer to the table. The following piece of code will solve this problem. Have to implement this in WDDOMODIFYVIEW method of the view. This thing works comrades enjoy...
      DATA : lr_cmp_usage TYPE REF TO if_wd_component_usage,
             lr_if_controller  TYPE REF TO iwci_salv_wd_table,
             lr_cmdl   TYPE REF TO cl_salv_wd_config_table,
             lr_col    TYPE REF TO cl_salv_wd_column.
      DATA : node_year  TYPE REF TO if_wd_context_node,
             elem_year  TYPE REF TO if_wd_context_element,
             stru_year  TYPE if_alv_layout=>element_importing,
             item_year  LIKE stru_year-i_current_year,
             lf_string    TYPE char(x),
      DATA: lr_column TYPE REF TO cl_salv_wd_column.
      DATA: lr_column_header TYPE REF TO cl_salv_wd_column_header.
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    Get the entered value from the input field of the screen
    node_year  = wd_context->get_child_node( name = 'IMPORTING_NODE' ).
    elem_year  = node_year->get_element( ).
      elem_year->get_attribute(
       EXPORTING
        name = 'IMPORT_NODE-PARAMETER'
       IMPORTING
        value = L_IMPORT_PARAM ).
      WRITE L_IMPORT_PARAM TO lf_string.
    Get the reference of the table
      lr_cmp_usage  =  wd_this->wd_cpuse_alv( ).
      IF lr_cmp_usage->has_active_component( ) IS INITIAL.
        lr_cmp_usage->create_component( ).
      ENDIF.
      lr_if_controller  = wd_this->wd_cpifc_alv( ).
      lr_column_settings = lr_if_controller->get_model( ).
    get column by specifying column name.
      IF lr_column_settings IS BOUND.
        lr_column = lr_column_settings->get_column( 'COLUMN_NAME').
    set Header Text as null
        lr_column_header = lr_column->get_header( ).
        lr_column_header->set_text( lf_string ).
    endif.

  • How do I change the color of text in Messages?

    How do I change the color of text in Messages? It was easy to do before, but I can't seem to find it after the upgrade.. is it a hidden menu option?  The gray text is really annoying.

    Two possible ways are available
    Set the text with and html text string like "<html><font color-red>" + text + "</font></html>"
    or get the cellrenderer, cast to the DefaultCellRenderer and call setForeground or background or implement or your own cellrenderer to do the custom coloring (this could maybe depend on indexes)
    ICE

  • How can i change the sequence of text element in standard driver program ?

    Hi,
    can u tell me how can i change the sequence of text element in standard  sapscript driver program.. without making a zcopy of standard driver program.
    My problem is when MEDRUCK form is getting printed for PO print , header text is coming before item. But the requirement is to come it after item.So how cani do that without making the zcopy of  SAPLMEDRUCK program..Is there any enhancement point in SAPLMEDRUCK driver program..where i can put my customise code for changing the sequence of text element ?

    Hi,
        Just copy the MEDRUCK to ZMEDRUCK. No need to copy the driver program.
    1) SE71Menu > Utilities > COpy from Client
    MEDRUCK ->>Client 000
    New formname ZMEDRUCK
    2) Now open the ZMEDRUCK in DE language in SE71
    3) Menu > Utilities > Convert original Language
    Change DE  to EN, save and activate
    4) Now open the ZMEDRUCK in EN language
    5) Goto Pagewindows > Main window,
    Look for the HEADER text Text element, copy the whole code under this Text element just after the ITEM text Text element, and comment the HEADER text above.
    Now the Header text Text element will be below ITEM text only. This will full fill your requirment.
    Now goto NACE transaction and add the copied ZMEDRUCK to the EF application.
    Regards
    Bala Krishna

  • Change the color of text item after execute query

    Dear friends
    I would like to know how can I make a tabular form like grid and chang the color of text item when (for exp in emp table) the value of sal column between 2000$ and 4000$.
    I used the SE_IEM_PROPERTY command but it change all of the text items of sal column.
    please help me
    thanks a lot

    Highlight the Existing Record in Forms
    (Compatible with 4.x, 5.x, 6.x & 9i)
    Step 1: Create a New Visual Attribute(BLUE_VA) (Color of highlighted record)
              Font – Arial
              Size – 8
              Style – Plain
              Font width - Normal
              Font Weight - Bold
              Foreground Color – Black
              Background Color – Blue
              Fill Pattern – Transparent
    Step 2: Create another Visual Attribute (WHITE_VA) (Default Color of the record)
              Font – Arial
              Size – 8
              Style – Plain
              Font width - Normal
              Font Weight - Bold
    Foreground Color – Black
              Background Color – White
              Fill Pattern – Transparent
    Step 3: Add Following code to Block-level Trigger WHEN-NEW-RECORD- INSTANCE, POST-BLOCK
    (Add to the block, which has these records)
    -- Following code will only highlight an item
    DISPLAY_ITEM(<block_name>.<item_name>,'BLUE_VA');
    -- Following code will highlight complete Record (ref: DISPLAY_ITEM example)
    DECLARE
              cur_itm VARCHAR2(80);
              cur_block VARCHAR2(80) := :System.Cursor_Block;
    BEGIN
    cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
    WHILE ( cur_itm IS NOT NULL ) LOOP
    cur_itm := cur_block||'.'||cur_itm;
    Display_Item( cur_itm, 'BLUE_VA');
    cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
    END LOOP;
    END;
    Step 4: Add Following code to Block-level Trigger PRE-RECORD, PRE-BLOCK
    (Add to the block, which has these records)
    -- Following code will only highlight an item
    DISPLAY_ITEM(<block_name>.<item_name>,'WHITE_VA');
    -- Following code will highlight complete Record (ref: DISPLAY_ITEM example)
    DECLARE
              cur_itm VARCHAR2(80);
              cur_block VARCHAR2(80) := :System.Cursor_Block;
    BEGIN
    cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
    WHILE ( cur_itm IS NOT NULL ) LOOP
    cur_itm := cur_block||'.'||cur_itm;
    Display_Item( cur_itm, 'WHITE_VA');
    cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
    END LOOP;
    END;
    I am using the above code in one of my forms and I so far haven't seen any problem

  • How do I change the colour of text in a cell in a JTable?

    I am trying to change the color of the text in a single cell in a JTable. I have tried not adding a cell renderer and it changes the colour of text in all cells.
    I have tried adding a cell renderer to the table and it does the same ie all cells text colour changes.
    I am able to add a cell renderer to a column and it changes all the cells in the column.
    I cannot figure out how to change just one single cell's text colour without effecting the other cells.

    Ok, so if i create my own cell renderer do I set it as the default renderer for the whole table i.e.
    table.setDefaultRenderer(MyCellRenderer, renderer);
    Does this set one cell renderer for the whole table or is there an individual one for each cell?

  • How do you change the color of text messages?

    Can you change the color of text messages?  If so, how?

    Two colors. Blue and green.
    Green is for text message. Blue is for iMessage. You can't change these, though.

  • How can I change the content of JTable?

    Dear friends.
    I have an JTable. I create tablemodel for it and fill out it by data.
    In application at the run time I always need to change the content of whole table. For example I have a frame with JTree and JTable. When I click on the tree node I need to retrieve the data about this node in the JTable.
    Advice me please how can I do that and give an example please.
    Thank you.

    SOL I:
    There solution can be simple if u've written a model for it.
    If u are updating the data of the table by the setValueAt() method of the tableModel, in ur calling(mutating code), then just append a sinle line at the end of the method. U just need to fire a data change event corresponding to the event that has happened.
    void setValueAt(Object aValue, int rowIndex, int columnIndex) {
    - - - - - - - ur code
    //then last line can be
    fireTableDataChanged() ;
    OR
    fireTableCellUpdated(int row, int column);
    OR
    fireTableStructureChanged() ;
    depending uopn what has happened.
    SOL II:
    U may also try calling the method fireTableDataChanged(); from the place where the table data is getting mutated.
    like:
    ((AbstractTableModel) table.getModel()).fireTableDataChanged();
    [email protected]

  • HT3069 How can I change the content list when I change residence country?

    I bought an Apple TV in Mexico but came to came to the US to work on a project, so I brought my Apple TV with me. I already changed the credit card to an American one and all the country settings, but it still displays the Mexican list. How can I change the movie content?

    Purchases will be tied to the original account. Your US account will not have access.
    If your Apple TV is not displaying US content make sure the Apple TV location settings are correct. DNS should be on automatic.

  • How can I change the appearance and text on 'Continue from where you stopped last time?' dialogue

    Hi,
    I would like to change the appearance (color, header and text) of the 'Continue from where you stopped last time?' dialogue
    Could you please help me where to find the files to be edited and how to do so.
    Thanks in advance for your help!!!
    Stephanie

    Hi Stephanie,
    Unfortunately there is no way to change the text or appearance of this dialog box. You are stuck with it as is.
    www.cpguru.com - Adobe Captivate Widgets, Tutorials, Tips and Tricks and much more..

  • DITA + FM: How can I change the automatically insert text for the element info?

    Hello,
    when I insert the element info in a topic, FrameMaker automatically insert the text "ADDITIONAL INFORMATION:".
    How can I change that?
    I know how to change it for the elements result, postreq and prereq. I change the text format rules for the elements in the topic.edd.
    But the element info has no text format rules and when I search in the topic.edd for the text "additional" or "info" I dont find something.
    With kind regards,
    Nina

    Hi Scott,
    thanks a lot for your reply! I've found the code in the EDD on page 65.
    "... is using the @type attribute value ..." - I have changed the values in the DTD (Structure\xml\DITA\app\dtd\commonElements.mod), but that didn't had any effect, not even after a restart of FM. I also changed the note attribute values in "dita-map.edd.fm" and "topic.edd.fm". Nothing. When I insert a note tag FM still inserts the original values.
    Did I missunderstand something? Further tips?
    Marcel

  • How can I change the format of text pasted into a Mail email from another document?

    I paste some text from a word document into an email in Mail.  In the word document, the text was indented .5" from the right margin.  In the Mail email document, the text also appears indented .5" from the right margin.
    But since this was the last text in the email I am composing, my text following the pasted-in part continues at the indented "style" of the pasted in text.  And thre are no controls for changing this indentation on subsequent text in that email, nor can you chage the indentation formatting of the text pasted in.
    Even when you select "decrease indentation" under the format/indentation options in the menu bar, Mail will not reduce a "pasted-in" paragraph indentation nor will it return a subsequent text paragraph you type in manually back to a left-adjusted margin.
    Am I miising something?
    Is there a way to see something in each Mail message composition window akin to what you see in a word processing document that allows you to set margins and indentations and tabs for individual paragraphs?  Just like the Formatting controls you have here in the Apple Support communities when you ar composing a message and that I used to indent this paragraph?
    And then used to return this paragraph back to the original left adjusted formatting?
    Steve

    Thanks for the reminder.  I use the formatting toolbar but forgot to go there instead of the Format menubar item for Mail to try the indent and outdent commands.
    But, alas, that indent, outdent option has no impact on text pasted into the message.  It remains stuck at the indent level of the source text.
    Might the answer lie in switching to plain text and formatting there?  Tried that and no difference.
    I did discover that if you highlight text pasted in with its "own" indentation preference "baked in" you can indent that text further and even "outdent" it back to where it was, but you cannot shake it's original indentation status to get it back to full left margins.
    Steve

  • How can I change the ringtone for text messages (sms) at iPhone 4?

    With iPhone 3G it is not possible to change the ringtone with own sounds.
    Can I do it with iPhone 4?

    Yes, you can :-)
    Look at my homepage for ringtone!

  • How to properly change the server that is running service application?

    Hello
    In our SharePoint 2013 farm we use the User Profile service applications very heavily.
    I want to change the server that is hosting the service. The User Profile service application which is currently running on: (Server-1), But, I want it to be running on: (Server-2) instead.
    Is this (https://technet.microsoft.com/en-us/library/ee704549.aspx?f=255&MSPPError=-2147217396) the
    right/proper way to do it? What about the order?
    I mean: Should I go to: Manage services on server > Server-2 > Start: User Profile. 
    After that: Manage services on server > Server-1 > Snbsp;
    Or, The other way around:
    I mean: Should I go to: Manage services on server > Server-1 > Snbsp;
    After that: Manage services on server > Server-2 > Start: User Profile. 
    Or, Is it a totally different way? Does the same way apply on other service applications too e.g. Managed Metadata too ? 
    I am asking about this because I really want to be super cautious while doing this change to avoid crashing the service or corrupting it.
    Thank you !

    The order doesn't really matter if you're quickly doing this, but you could start it on the new and stop it on the old.
    User Profile Service should generally run on the 'WFE(s)' since it is an end-user facing service.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • How can I change the order of list item properties in the alert email sent to the assigned-to owner?

    Using SharePoint 2010 Foundation.
    I have an Issue list configured to send an email to the assigned-to owner (List Settings | Advanced settings | E-Mail Notification = Enabled). I have since added columns to the Issue list. All of the data from my columns appear in the email alert but the
    newest additions show up at the bottom of the list in the alert email instead of in the column order I have defined (List Settings | Issue Content Type | Column Order). However, if I click the "Mobile View" in the alert email I received, the Mobile
    View does have the items listed in the column order.
    Why are these different and how do I get the email alert to match my column order?

    Actually the view which you recieve requires the column ordering to be the way you prefer. So whatever is your default view, change the column orders and then check the email alerts.
    Alpesh Nakar's Blog
    Alpesh
    Just SharePoint Just SharePoint Updates
    SharePoint Saturday India Online
    Nov 20 2010 Contributing Author
    SharePoint 2010 Unleashed
    MCTS: SharePoint 2010 Configuration
    MCITP: SharePoint 2010 Administrator

Maybe you are looking for

  • Open a new url in  same  window

    I am displayed a button using web dynpro abap, if i click the button means a new url page should be opened in the same window. I did the application but when i click the button means a new window is opened.It should not be happened. Anyone can plz se

  • Regarding Java Proxy development in PI 7.1

    Hi all,          Can anybody provide us the step by step creation of java proxy development in PI 7.1 using SAP nteweaver developer studio7.1 Any useful links present for this? Edited by: sasitharan on Mar 3, 2009 9:18 AM

  • I just need serious help! Please!

    ok well.... i need to code a program that has about 5 different GUI's and each in a different class, and there is a claass where all the details of the Database for coustomer details is stored in an array but now i need each GUI to access the array a

  • Why won't Pages launch after updating iOS version?

    Hello, I just updated our iPad 1 from iOS v4.2.something to v5.1.1, and now Pages starts up, but then promptly exits.  I will try to delete and reinstall Pages, but after the big update, I had to reinstall the latest Pages anyways.  Thoughts?  Rick M

  • HT1918 hey this wed side don't help me in nothing

    hey I want download free games but I cant because they ask me for my credit card information, now the question is what can I do??