Select text of edited table cell

Hello,
I would like to have the text selected of a table cell i am editing. When i double click the cell, i can change the content of the cell, but i should manually select the text first.
I would like to have this text selected automatically.
Thank you in advance,
Rene Boere

Add a focus listener on the text field you are using in the cell editor. When the text field gets focus, tell it to select all of it's text. Something like this maybe:final JTextField tField = new JTextField();
tField.addFocusListener( new FocusListener() {
    public void focusGained( FocusEvent fe ) {
        tField.selectAll();
    public void focusLost( FocusEvent fe ) {

Similar Messages

  • Theme Editor: where to change backgroundcolor of editable table cells?

    Hi all,
    I need to change the color of an editable table cell.
    I navigated to the theme editor --> tables.There is a section "Editable Tables". The preview shows an example with three columns and tree rows. I want to change the backgroundcolor of the cell in the first row, third column (in SAP standard it is lightgrey).
    The backgroundcolor of the rows beneath can be changed in section "Selected Cells", the backgroundcolor of the first two columns in the first row can be changed by "Background Color of Standard Table Cell" but I can't find the field where I can change the color of the last cell.
    Best regards,
    Sandra

    Hi,
    The blue color come from your definitions on "Labels and Fields" to read-only color of input field.
    Regards,
    F.F

  • Text Wrapping in table cell

    Hi folks
    If the text in a table cell exceeds the width of cell then is it possible to make that cell scrollable.
    Or either can we scroll only text horizontally.
    I know PopIn is alternate for this problem but see if it is possible.
    Thanks is anticipation,
    Mandeep Virk

    Hi Guys thanks for quick response,
    I tried it using text wrapping but i did;nt see any difference. Can u please explain a bit it text wrapping is true then how a normal line will appear.
    Is using text wrap the text comes in two lines or have some what different feel.
    Mandeep virk

  • How to programatically select text for editing in an af:inputText control?

    Hello, I am new to jdeveloper 11.1.1.3.0 and have searched and searched for info. I must be using the wrong terms as I cannot find any info or example on how to programatically select text for editing in an inputText field.
    My request is to change an existing app so when the user presses a button, control should go to the inputText control (this part works, see existing backing bean code from another developer below) but automatically select the text within for editing by the user (saving the user from having to select the text first before editing).
    Backing bean code to set the focus to an inputText field:
    * sets the cursor to the given component id
    * @param  componentId of item on page
      public void setFocusOnUIComponent(String componentId) {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ExtendedRenderKitService service =
          Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
        UIComponent uiComponent = facesContext.getViewRoot().findComponent(componentId);
        service.addScript(facesContext,
          "Component = AdfPage.PAGE.findComponentByAbsoluteId('" + componentId + "'); Component.focus();");
      } I hope this isn't a dumb question and would appreciate it if someone can steer me in the right direction.
    Thank you for any info,
    Gary

    Hi,
    not a dumb question at all. Before answering it, here some comments on the code you pasted in your question
    1. UIComponent uiComponent = facesContext.getViewRoot().findComponent(componentId);
    This code line is not used at all in your method. So it seems you can get rid of it
    2. "Component = AdfPage.PAGE.findComponentByAbsoluteId('" + componentId + "'); Component.focus();");
    I suggest to change it to
    "var component = AdfPage.PAGE.findComponentByAbsoluteId('" + componentId + "'); component.focus();");
    as it is better coding practice to have variable names starting with a lower case letter and being flagged with the "var" identifier
    For pre-selecting text in an an input component, there is no API available in ADF Faces, which means you need to reach out to the rendered HTML ouput. To access the markup for the rendered component, you can try
    var markup = AdfRichUIPeer.getDomContentElementForComponent(component)
    If this markup returns the HTML input component then you can use JavaScript you find on the Internet to select the area of it. If it does not return the input component then you may have to use
    document.getElementById(componentId+'::content')
    Note however that working directly with generated HTML output bears the risk that your code breaks when - for whatever reason - the ADF Faces component rendering changes in the future
    Frank
    Frank

  • Goes to 'nothing selected' mode when editing tables entries? (Sometimes)

    When trying to edit entries in table cells pages sometimes flips into 'nothing selected' mode and return to the top of the table leaving the cell entry partially changed. This can happen anytime during the typing of characters to replace other text. Reselecting the cell and editng the text as before will then work!
    There was one occasion when Pages terminated with an error when I was changing the cell contents but when restarted it let me make the changes to the table cell without terminating.

    Pages Version is 5.2.
    The keyboard (cable connect version, not bluetooth) is clean and works OK with all my other apps.
    I use an Apple Magic Trackpad to move cursor and select cell/text etc.

  • Edit table cells in Dreamweaver 8

    In Dreamwever MX2004 if you have a 1 row, 2 column table, I
    can enter text in the left cell and not affect the right cell,
    otherwords, I can have text in the right cell and it does not move
    if I do a carrage return in the left cell.
    However in Dreamweaver 8 with the same situation, the text
    line in the right cell moves down one line for each carrage return
    in the left cell. Dreamweaver 8 does not leave an editable area
    abovr the text of the right cell so you can't backspace the text
    back to the top of the cell, thus, I can't have any alignment
    between the two cells.
    Any ideas on how to make Dreamweaver 8 behave the same as
    Dreamweaver MX2004
    Cheers,
    Linus Sagadore

    as a pure guess, it's got to do with the align attribute of
    the td tag, or
    the css being used.
    my guess is the code is set to vertically align the contents
    of the right
    cell. When you add content to the left cell, the right cell
    gets taller, so
    the contents of it appear to move down.
    if you're still unclear- please make a page with each
    version, with a table
    that does this, and upload someplace and give a link to the
    uploaded pages.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • Can't vertically center text within a table cell with a picture next to it

    I have a table and each cell has a picture in it (which was "cut" from another part of the document and "pasted" into the cells). Next to it, I typed a few words. I want the words to be centered vertically within the cell. However, everytime I click on the vertical centering in the inspector, it moves the picture and the text remains at the very bottom of the cell. The text is "tied" to the picture. I've tried everything... highlighting the text, same thing. Can't figure it out!! Is there any way to do this without inserting text boxes??

    Vertical align works on text within text boxes and within table cells.
    I have just checked this using a table with:
    *1st cell* Inline Picture with caption under. Cell sizes to fit
    *2nd cell* Same as first, picture scaled down. Text and image centre vertically.
    *3rd cell* Caption only, vertically centred.
    It works and I have wrap turn off on the image, before I pasted it in.
    On rereading the O.P.'s post it seems to be saying contradictory things. That the text is "tied to the picture" which is what you would expect of inline graphics and that the text is stuck in the bottom the cell.
    Without a picture and a better description of the problem we are none the wiser.
    I am just guessing but perhaps the O.P. has the image and Inline graphic on the same line and can't understand why the bottom of the text and the bottom of the image are aligned.
    If this is the case it is a misunderstanding of what inline graphic means. The image acts just like a character in the text and sits on the text baseline, it is not an independent object.
    It is possible to shift text next to the image or the image itself by selecting either and altering:
    +Inspector > Text > More > Baseline Shift+
    But frankly you would be better separating the 2 and putting the text in the cell to the left or right of the image.
    Peter

  • Highlighting text in a table cell

    Im trying to get text in a table have it background shaded a different colour to the rest of the table cell but it doesnt work. No exceptions are thrown does anyone have any idea.
    public Component getTableCellRendererComponent(JTable table,
            Object value,
            boolean isSelected,
            boolean hasFocus,
            int row,
            int column)
            setFont(table.getFont());     
            this.setText(value));
            this.selectAll();
            this.setSelectionColor(new Color(0,0,255,100);
            return this;
        }

    The answer is similar to what someone else asked recently for highlighting text in a JFormattedTextField cell.
    class MyFocusListener extends FocusAdapter
    public void focusGained(FocusEvent e)
    SwingUtilities.invokeLater(new Runnable()
    public void run()
    selectAll();
    Put that in your cell editor or its base class. You can change the color or whatever you want. I think the problem is a timing thing where normal focus processing is interrupting your changes. So give the focus processing time to run with this Runnable triggering your processing to occur on the Awt thread (as is proper) after the system is doing whatever it wants to do. Let us know if it works for you.

  • Text Box in Table Cell

    I'm attempting to insert a text box into a table cell but can't. I can't drag one in there either. Are there settings I need to adjust to make this work?

    I don't believe you can insert a text box into a table cell, but you can place a text box on a table cell. The trick is to make the text box floating with wrap turned off.

  • Edit table cells

    i have edited the setValueAt method of the TableModel interface to enable editing of cells in my JTable - in-situ. This works fine. However, i would like it so that when any change is made to the table data, it is automatically sorted depending on how it was sorted before the change was made. i have:
    public void setValueAt(Object aValue, int row, int col) {
            if (col == 0) {
                bookList[row].setBookNumber(Integer.parseInt((String)aValue)); // Populates cell with new book number
                if (lastSort == "number") {
                    listByNumber();
            } else {
                if (col == 1) {
                    bookList[row].setTitle((String)aValue); // Populates cell with new book title
                } else {
                    if (col == 2) {
                        bookList[row].setAuthorPrename((String)aValue); // Populates cell with new author prename
                    } else {
                        bookList[row].setAuthorSurname((String)aValue); // Populates cell with new author surname
        }i would put more if statements in later for different sort methods but at the moment ill just stick with one. My problem is that the array is being sorted correctly, but the table doesn't update automatically to show the change. what DOES happen - is when you click on each row of the table, it changes until it is in the correct order. this leads me to think that the sorting works fine, but somehow my table model isnt reflecting the changes? can any help me update the table in real time?

    no luck :( i tried:
       public void setValueAt(Object aValue, int row, int col) {
            if (col == 0) {
                bookList[row].setBookNumber(Integer.parseInt((String)aValue)); // Populates cell with new book number  
                listByNumber();
                fireTableDataChanged();and extended AstractTableModel but it still didnt work. is there anything else i would need to do?

  • Selecting text field from table ignoring capitalization

    Hi,
    i'm doing a read on a table using select.....where text in s_text . if i want to ignore the capitalization; how to perform the read.
    for eg : if the text is saved as 'Name' and in my select criteria if i specify the selection text as 'name' it should pick up even if 'N' is not in CAPS in DB.
    Thanks,
    GV.

    Hi,
    The Function Module, STRING_UPPER_LOWER_CASE will convert your string to lower case except the first letter
    So if user input as name, after passing it to FM you will get the value as 'Name' and then you can able to check your condition
    May this will help you
    Rani

  • May I create  a  editable table cell in web dynpro java?

    Hi erveryone:
    i can see the readonly property of table in studio,but i can't input data after deployed view to the portal,can i create table include editable cell?
    best regard
    reefish

    Hi,
    When u create the table, choose apply template option>choose table>select the context node to be bound. In the Table Binding Wizard, choose the editor as Input Field.
    Regards,
    Rachel

  • [pages 5.0.1] How can I add Pictures to the Text in a Table cell?

    Hi,
    is it possible to add a graphic to a cell in a table, where i have already entered some text?
    Everytime I insert the graphic, Pages makes it to the cell's background...
    Can anyone help me?
    Thanks.

    The feature to add images in tables is gone, ike about another 90 features that exists in Pages 09.

  • Multiple selected text frame to table

    I am looking for a script that will allow me to select multiple text frames at one time and have the contents in those text frames converted to tables.
    What I have to do now is place the cursor in one text frame, select all, select menu item "convert to table", the defalt dialog appears and I click ok.
    I have ten text frames on a page (for example). The manual process means I have to do the text to table 10 times per page.
    So, I would like a script that will allow me to select all 10 text frames and convert the content of each frame to a table.
    Any suggestions are appreciated.
    RPP

    This should do it:
    if (app.documents.length > 0 && app.selection.length > 0)
      for (i = 0; i < app.selection.length; i++)
        try {app.selection[i].texts[0].convertToTable ("\t", "\r")}
          catch (_) {}
    Peter

  • How do i delete text from a table cell

    I want to delete text from a cell or table but not the cell or table themselves. How do I do this? The 'delete' function does not work.

    Mac Word 2011. i found the answer: 'fn' (function') key + 'Delete' key. if i had a full desktop keyboard it would be the 'Del' key, NOT the 'Delete' key.

Maybe you are looking for