Cursor position in the mx:TextInput

Hi guys, does anyone knows how to set the exact cursor
position in the mx:TextInput ? For example I want to set cursor
after the second symbol. Is that possible ?

<textinputID>.setSelection(position, position);
for example, if i want my cursor in the second position of a
textinput named "nameField":
nameField.setSelection(1,1);
*used 1 because index starts at 0

Similar Messages

  • How to get the cursor position in the text edit box?

    Hi, all.
    I want to get the cursor position in the text edit box
    to insert some data.
    But I don't know how to get.
    Can someone give me some advice?
    BestRegard.
    Miya.

    Hi Miya,
    Write your own textSelectionSuite for this.
    and use ITextTarget->GetRange() function.
    Thanks and Regards,
    Yopangjo.

  • [ADF Faces] set cursor position to the first column input text in ADF table

    How do i set the cursor position to the first column input text when i Insert a blank row?
    My idea is to implement using javascript. document.setfocus() but how do i do it from the backing bean code? or how do i install custom js to call document.setfocus()?
    any ideas?
    Message was edited by:
    user450391

    Did you try by iterating the selected row?
    Bind the table with the managed bean and then try with below code:
    RichTable empTable;
    RowKeySet selectedEmps = getEmpTable().getSelectedRowKeys();   
    Iterator selectedEmpIter = selectedEmps.iterator();
    DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding empIter = bindings.findIteratorBinding("EmpView1Iterator");
    RowSetIterator empRSIter = empIter.getRowSetIterator();
    while(selectedEmpIter.hasNext()){
       Key key = (Key)((List)selectedEmpIter.next()).get(0);
       Row currentRow = empRSIter.getRow(key);
       System.out.println(currentRow.getAttribute("Ename"));

  • Java GUI cursor position in the window, mixed text editable and uneditable

    Hello,
    I primarily program in VBScript for Client Acces; but, I wanted to start creating user interfaces with Java.
    VBScript is not compiled on the private drive and anyone can learn how to do a program from well documented code; however, a compiled .class Java program does not have to be sent with the .java source code to work. The compiled program is unreadable by others and uneditable by others. Although I can do what I want with ActiveX programming, I want to use Java instead because it will prevent others from knowing how I program my solutions.
    The NetBeans IDE allows for controls to be dragged and dropped onto a screen; however, I want to know how to have uneditable and editable fields on the same page while allowing the cursor to be anywhere on the page and report its cursor position just as it is reported in Client Access.
    Does Java support the .Net Framework; or, does it have its own objects and methods to pull the cursor position in a window? I need the row and column, not the x and y coordinates.
    Java How To Program, Sixth Edition, has some deprecated code examples and I found working solutions from the Java Almanac. However, I did not see an example of this sort.
    What I will do once I know how to track the cursor position in the window is generate a Java based training module. Every computer at my workplace has Java runtimes installed, none of them have the .Net Framework installed. Java has a lot of tools that allow me to replace all my ActiveX programming with Java programming.
    Have a great Day!
    Jesse Grune.

    textArea.getCaret().getDot();
    or the shorter
    textArea.getCaretPosition();

  • ITunes 6.0.1.3 "forgets" last cursor position in the library

    Hi there,
    I've a minor issue with my iTunes library. When I'm comfortably browsing my library using the "Browse"-Button, switching to e.g. my CD in iTunes and after that returning to the library the last cursor position with selected title and/or album is lost. So anew I've always to navigate manually to the previous selected album which it's bit annoying especially when you've to manage a larger library.
    Any hints?
    Thanx!
    Steve
    5G 60GB (European version) Windows XP
      Windows XP  

    DEZ3124,
    I want to change the default location of the music libary, so I went through the edit | preferences | consolidate library processes...which seemed to work fine.
    This method will change the location of the iTunes Music folder but the the iTunes folder itself will be left behind in its original place: C:\Documents and Settings\user name\My Documents\My Music. This makes iTunes (and by extension will also make you) much happier and in this case you'll be well-advised to let it have its way.
    Note that all the actual music files you now have, as well as those you will add in the future(which take up the bulk of the space on your hard drive), will be in the new location. The iTunes folder will be left behind with the iTunes Library files which don't take up much space at all ... if that's a concern.

  • How to get the index of the word at current cursor position in the word?

    Dear All
    I am implementing a spell checker of my native language in Word. Whenever I run spell checker it start from the first word. How can I make it to start from the current cursor position? How can I get the index of the word at the current cursor position?
    Thanks in advance.
    Dharam Veer Sharma

    hi Dharam Veer Sharma,
    Thanks for sharing the solultion with us.
    It is helpful for others who have the same issue. And if you have any Office developing issue, please feel free to open a new thread.
    Have a nice day.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to control the cursor position in the Table control in Module pool

    Hi,
    Can any body tell me how to change the cursor positon from last field of the first record to the
    first field of the second record , when user presses enter in the last field in the module pool
    programming.
    Thanks

    Hi,
    Please avoid posting duplicate posts.
    Re: how to get the cursor position from screen in module pool program
    Nag

  • Customizing cursor positioning in the delivery

    We are currently running SAP 4.6C with support pack level 48. We recently upgraded from support pack 29. Per OSS note 507967 which was applied per support pack 32, the cursor on all tabs under the Delivey Overview screen is placed on the first open lineitem's material number. Prior to this support pack update, the cursor was positioned on the first lineitem's item number field. Is there anyway we can revert back to having the cursor placed on the first lineitem's item number WITHOUT modifying the SAP code?

    Hi,
    Please create a OSS message reporting the problem to SAP.
    You can create OSS message on the website service.sap.com.
    You would need to have OSS Id to be able to report the problem to SAP.
    SAP will provide another note for the problem caused due to support pack upgrade.
    This is the only option other than modifying the code.
    <b>Reward if helpful.</b>Thanks,

  • How to read cursor position in the following code?

    I am using reuse_alv_list_display
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    DATA:gs_selfield TYPE slis_selfield,
    ok_code LIKE sy-pfkey.
    CASE r_ucomm.
    WHEN '&IC1'.
    gs_selfield = rs_selfield.
    IF gs_selfield-fieldname = 'EBELN'.
    MOVE 'EVRTN' TO rs_selfield-fieldname.
    SET PARAMETER ID 'VRT' FIELD rs_selfield-value.
    SET PARAMETER ID 'BES' FIELD rs_selfield-value.
    CALL TRANSACTION 'ME38' AND SKIP FIRST SCREEN.
    ELSE.
    IF gs_selfield-fieldname = 'MATNR'.
    SET PARAMETER ID 'MAT' FIELD rs_selfield-value.
    CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
    ENDIF.
    ENDIF.
    ENDCASE.
    ok_code = sy-ucomm.
    READ TABLE it_rep_tab INTO wa_rep_tab INDEX l_selfield-value.
    SET PARAMETER ID 'MAT' FIELD wa_rep_tab-matnr.
    SET PARAMETER ID 'WRK' FIELD wa_rep_tab-werks.
    CASE ok_code.
    WHEN 'MD04'.
    CALL TRANSACTION 'MD04'." AND SKIP FIRST SCREEN.
    WHEN 'MMBE'.
    CALL TRANSACTION 'MMBE'." AND SKIP FIRST SCREEN.
    WHEN 'MD51'.
    CALL TRANSACTION 'MD51' ."AND SKIP FIRST SCREEN.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDFORM.
    Please help me............
    but here not getting values ib l_selfield-value when  I place in the toolbar.
    Please help me.

    you have to read your itab in a workarea yourself using the correct index using the returned rs_selfield-tabindex.
    so you have allways the correct values.

  • Locating the cursor position

    Is it possible to locate the cursor position in a text item? in other words can I find the number of characters to the left of the cursor in a text item?
    I really appreciate any kind of input on this.
    null

    I have to insert user selected variables that show up in a LOV into the text item at the cursor position.
    A sloppy workaround for this problem is asking the user to put in a pre defined symbol where ever he/she wants to insert the variables and then replace the variable with the value selected from the LOV using the REPLACE function. There is always a chance of error here!
    Instead if there is a way to know the cursor position, like the no. of characters to the left of the cursor or the cursor co-ordinates.............

  • Can any body answer this-Want to set the cursor position in textfield.

    i want my cusor position in textfield at the initial position which will come by default.
    but when i'm using the textfields in an inner class i'm getting the cursor position at the end of the text in text filed.pls can any body answer this.
    thanks in advance.
    if want run this example.
    import java.awt.*;
    import java.awt.event.*;
    class Testing extends JFrame implements ActionListener
         Container cnt;
         JButton jd;
         JTextField jt1;
         JTextField jt2;
         Testing()
              cnt = getContentPane();
              cnt.setLayout(new FlowLayout());
              jd = new JButton("OK");
              //jd.setBounds(50,50,100,30);
              cnt.add(jd);
              jd.addActionListener(this);
         public void actionPerformed(ActionEvent ae)
              Object but = ae.getSource();
              System.out.println("in action 00000");
              if(but.equals(jd))
                   System.out.println("in action ");
                   call();
                   return;
         void call()
              System.out.println("in action 1111111111");
              Inner inn = new Inner();
              inn.jdlg.show();
         public static void main(String s[])
              JFrame jf = new Testing();
              jf.setSize(200,200);
              jf.show();
         class Inner
              JDialog jdlg;
              //JTextField jt1;
              //JTextField jt2;
              Container cnt;
              Inner()
                   jdlg = new JDialog();
                   JLabel jla = new JLabel("Label");
                   jt1 = new JTextField();
                   jt2 = new JTextField(5);
                   cnt = jdlg.getContentPane();
                   cnt.setLayout(new FlowLayout());
                   cnt.add(jt1);
                   cnt.add(jt2);
                   jt1.setText("aaaaaaaa");
                   jt2.setText("bbbbbbbb");
                   System.out.println("the text "+jt1.getText());
                   jdlg.setSize(200,200);

    JTextFiled.setCaretPosition(0);

  • Cursor position on screen data in module pool programming(urgent)

    Hi all,
    I developed a module pool  program which will save the data after  scanning the barcode data.
    In my program screen 100 is there which contains field  ‘2dbar’. scanned data is comming to 2dbar field.
    we r doing scan 4 times.once for vendor number,once for material no. like this.
    After 1st scan, vendor number will come to field ‘2dbar’.
    Then I developed logic to put comma after each scanned data come to this field ‘2dbar’.
    MODULE put_comma INPUT.
    CASE OK_CODE.
    when ''.
    move 2dbar to 2dbar1.
    clear 2dbar.
    concatenate 2dbar1 ',' into 2dbar2.
    *replace 2dbar with 2dbar2 into 2dbar.
    move 2dbar2 to 2dbar.
    *write 2dbar2 to 2dbar.
    condense 2dbar no-gaps.
    *move '' to 2dbar.
    *set cursor field 2dbar offset 5.
    *write
    ENDCASE.
    ENDMODULE.                 " put_comma  INPUT
    By above logic, comma  comes to the starting position of 2dbar after each scan. i.e cursor position is coming to the starting position of screen field ‘2dbar’.
    Now  I need to move the cursor position after the comma position on 2dbar after each scan.
    after 1st scan, 2dbar contains
    vmotorola
    then my logic puts a comma when u put enter on screen 100.
    now 2dbar contains
    vmotorola,
    i should get the cursor position after the comma.but i am getting cursor position before 'v'.so how to move this cursor position  beyond comma after each scan.
    I added set cursor  command but it is not working.plz
    What is the logic, I need to put in PAI  to move the cursor on selection screen.
    Already the logic I have mentioned.  with that logic, I can put comma.now I need to add cursor movement logic  to move the cursoron  on screen field ‘2dbar’.
    Plz reply me as it is urgent.
    Thanks in advance.
    Regards
    pabitra

    CASE OK_CODE.
    when ''.
    move 2dbar to 2dbar1.
    clear 2dbar.
    concatenate 2dbar1 ',' into 2dbar2.
    move 2dbar2 to 2dbar.
    condense 2dbar no-gaps.
    len = strlen ( 2dbar ).
    len = len - 1.
    set cursor field 2dbar offset len.
    ENDCASE.
    ENDMODULE. " put_comma INPUT

  • ALV-Grid - Get cursor position

    Hi,
    I replaced the table control in my dynpro with a custom container and placed an ALV-Grid in there.
    So, my problem is now to get the cursor position when the user double clicks at the text in a cell.
    It´s important for me to know at which position at the text he double clicked.
    e.g.:
    | Nr |Text   |
    |----|-------|
    |   1|Hello  |
    |   2|Test   |
    The user clicks double between the 'e' and 's' at line 2 ('Test').
    I need following information:
    line 2
    column 2
    offset 3 (position, where the user clicked)
    When I'm using the table control, it's no problem with
    the ABAP-statement 'GET CURSOR' and property 'OFFSET',
    but I didn't find a method with the same result for ALV-Grid.
    Maybe you know a possibility?
    Thank you.
    Regards from Germany

    hello,
    go through these links.these links will surely solve your problem.just have a luk.
    Get the cursor position row number in a table control.
    upper is for table-ctrl
    if you are working with alv.you can achieve it by.
    call method cl_gui_control=>set_focus
    exporting control = w_grid.
    w_grid is ur gid name.
    go through this link also
    Get cursor position from grid
    regards,
    Shweta
    Edited by: Shweta Joon on Aug 20, 2009 1:15 PM

  • Cursor positioning in table control: marking content of a field

    Hello everybody,
    I use a table-control for data input. For fast data input, my customers need dynamic positioning of the cursor. I'm using the set cursor field ... line ... statement and it works fine, except for one problem with a large text-field:
    Is it possible to set the cursor in a field plus mark all the content of the field? The behaviour, i'm looking for is that any input in the field will replace the existing content. Is there any other option?
    Thank you for any suggestions, regards, Kathrin!

    So you want dynamic cursor positioning within a table control. Take a look at FM SCROLLING_IN_TABLE and demo program DEMO_DYNPRO_TABCONT_LOOP. If this does not address your requirements the you can do it manually as follows:
    For example, your internal table has 30 rows, your table control displays 10 rows (value of sy-loopc) at one time. The value of <tabctrl>-top_line contains 11, meaning you are at the second page of table control. Your cursor is at 12th row and now on pressing ENTER, you want the cursor to be positioned at 13th row.
    In your PAI, issue the statement GET CURSOR LINE <lineno>. This will give you the current cursor position in the table control with reference to the top row currently displayed. So the value of <linno> will be 2.
    In your PBO, calculate the next line no to position your cursor into. This can be done by the formula:
      next_line = <tabctrl>-TOP_LINE + <linno> - 1.
    Then issue the statement SET CURSOR FIELD <field_name> LINE <next_line>.
    Hope this helps.
    Regards
    Message was edited by: Shehryar Khan

  • How can I get a cursor position?

    Hi Everyone!
    In my TextArea, there is a blinking cursor.
    How can I get the cursor position not the mouse position.
    Thanks,

    Thanks JefferyGong!
    That is selection index number, not the coordinate point.
    I want to know point position.
    Gyi

Maybe you are looking for