Setting focus in TextArea using AWT

I have looked at all the documentation for the TextArea in the API and cannot work out how to set the focus in a TextArea when a frame is loaded. Should it go in the constructor? the main method? the TextArea? I have tried to use hasFocus() but nothing is happening. Also how could I launch a dialog box when one of the menu items is selected? I'm trying to write a notepad application in Java. Thanks for any help
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class textpad extends Frame implements MouseListener{
TextArea inputarea;
GridBagLayout c;
MenuBar mb;
Menu filem, editm, searchm, helpm;
MenuItem newmenui, openmenui, savemenui, saveasmenui, exitmenui;
MenuItem undomenui, cutmenui, copymenui, pastemenui;
MenuItem findmenui, findnextmenui;
MenuItem helptopmenui, aboutmenui;
    public textpad(String title)
        super(title);
        c=new GridBagLayout();
        setLayout(c);
        setLayout(null);
        setSize(400,300);
        setBackground(Color.gray);
        //set position frame appears in screen??
        TextArea inputarea = new TextArea("Does it work?");
        inputarea.setBackground(Color.white);
        inputarea.getAccessibleContext();
        inputarea.setSize(399,270);
        add(inputarea);
        //set position within frame??
        //add MenuBar
          mb = new MenuBar();
          setMenuBar(mb);
          //Add File Menu to Bar                
          filem = new Menu("File");
          mb.add(filem);
          newmenui = new MenuItem("New");
          filem.add(newmenui);
          openmenui = new MenuItem("Open");
          filem.add(openmenui);
          savemenui = new MenuItem("Save");
          filem.add(savemenui);
          saveasmenui = new MenuItem("Save As");
          filem.add(saveasmenui);
          exitmenui = new MenuItem("Exit");
          filem.add(exitmenui);
          //Add Edit Menu to Bar
          editm = new Menu("Edit");
          mb.add(editm);
          undomenui = new MenuItem("Undo");
          editm.add(undomenui);
          cutmenui = new MenuItem("Cut");
          editm.add(cutmenui);
          copymenui = new MenuItem("Copy");
          editm.add(copymenui);
          pastemenui = new MenuItem("Paste");
          editm.add(pastemenui);
          //Add Search Menu to Bar
          searchm = new Menu("Search");
          mb.add(searchm);
          findmenui = new MenuItem("Find");
          searchm.add(findmenui);
          findnextmenui = new MenuItem("Find Next");
          searchm.add(findnextmenui);
          //Add Help Menu to Bar
          helpm = new Menu("Help");
          mb.add(helpm);
          helptopmenui = new MenuItem("Help Topics");
          helpm.add(helptopmenui);
          aboutmenui = new MenuItem("About Notepad");
          helpm.add(aboutmenui);
     public static void main(String args[])throws IOException
       textpad textpad1=new textpad("Untitled - Notepad");
       textpad1.show();
     public void mouseClicked(MouseEvent e){}
     public void mouseEntered(MouseEvent e){}
     public void mouseExited(MouseEvent e){}
     public void mousePressed(MouseEvent e){}
     public void mouseReleased(MouseEvent e){}
    

a very curious thing just happened when I ran it. The
bits of the constructor were being created on the
screen and the test String "Does it work" flashed up
then disappeared as the MenuBar was created. I have
also just changed the layout to null. Do I need to
re-position my TA? What do you think? Thanks for
your help by the wayAs long as you can see the TA, you shouldn't need to re-position it. Try changing the bg color. Something tells me that maybe the chars are being painted on in white, so you can't see them because their color matches that of the bg color. I could be wrong, though.
It is weird to be the one trying to solve somebody else's problem. I was the one getting the answers just a few short months ago...:)

Similar Messages

  • Setting Focus In Textarea

    Ok,
    I have a java program I've bundled into a jar and then packaged into a Win32 executable. I have windows associate a particular filetype (.wri) to my program.
    When I click a .wri file and open it, it loads data to a textarea. Now when I scroll down the textarea and finally click in the textarea, it resets me to the top of the textarea. Now, if I open the executable first, then go through the program to open a .wri file, I can scroll down to the bottom of the textarea, click in the textarea and I do not get reset to the beginning. I need a way to prevent the resetting of the textarea. I've tried using some of the Window methods for setting Focus, but none seem to work. Any ideas why this is happening via the one way and not the other. I'm open to any ideas. This known bug frustrates many because the .wri files being opened have over 1000 lines of text. Thanks in advance!

    i think yu can use setFocus by using lostFocus event.
    use Focuslost()

  • Remove / set focus on ALV using objects

    I have a screen with 6 subscreen and 6 customercontainers with each 1 ALV, I have 6 ALV's on the same screen, some of the ALV's are only display, and some are for input, my problem is that each alv have fokus on the first cell I want to remove the fokus in all display alv's, I am using the method "set_current_cell_via_id" to place the fokus in edit cell for the alv's with editable cell's, but how to remove fokus in alv, where only display ?
    Best regards Jørgen Jensen INIT A/S

    Hello Jørgen
    This is one of the rare occasion where I believe that something is NOT possible with SAP.
    You may have a look at my sample report
    ZUS_SDN_SPLITTER_CONTAINER and play around with various methods yet I doubt you will be successful. 
    *& Report  ZUS_SDN_SPLITTER_CONTAINER
    REPORT  zus_sdn_splitter_container.
    **type-pools:  abap.
    TYPES: ty_t_knb1    TYPE STANDARD TABLE OF knb1
                        WITH DEFAULT KEY.
    TYPES: BEGIN OF ty_s_control.
    TYPES: cell    TYPE REF TO cl_gui_container.
    TYPES: grid    TYPE REF TO cl_gui_alv_grid.
    TYPES: data    TYPE ty_t_knb1.
    TYPES: row     TYPE lvc_s_row.
    TYPES: layout  TYPE lvc_s_layo.
    TYPES: variant TYPE disvariant.
    TYPES: END OF ty_s_control.
    TYPES: ty_t_control  TYPE STANDARD TABLE OF ty_s_control
                         WITH DEFAULT KEY.
    DATA:
      gs_control       TYPE ty_s_control,
      gt_controls      TYPE ty_t_control.
    DATA:
      gd_repid         TYPE syst-repid,
      gd_okcode        TYPE ui_func,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_splitter      TYPE REF TO cl_gui_splitter_container,
    **  go_cell          TYPE REF TO cl_gui_container,
    **  go_grid          TYPE REF TO cl_gui_alv_grid,
      gs_layout        TYPE lvc_s_layo.
    DATA:
      gd_msg           TYPE bapi_msg,
      gd_perc          TYPE i,
      gd_lines         TYPE i,
      gd_idx           TYPE i,
      gd_cnt           TYPE i,
      gt_knb1          TYPE STANDARD TABLE OF knb1.
    PARAMETERS:
      p_row    TYPE i  DEFAULT '3',
      p_col    TYPE i  DEFAULT '3'.
    START-OF-SELECTION.
      PERFORM init_controls.
      DESCRIBE TABLE gt_controls.
      gd_lines = syst-tfill.
      SELECT * FROM knb1 INTO TABLE gt_knb1 UP TO 100 ROWS
        WHERE bukrs = '1000'.
      LOOP AT gt_controls INTO gs_control.
        gd_idx = syst-tabix.
        gd_cnt = syst-tabix * 5.
        gd_perc = ( syst-tabix * 100 ) / gd_lines.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
            percentage       = gd_perc
    *       TEXT             = ' '
        gs_control-data = gt_knb1.
        DELETE gt_knb1 INDEX 1.
        "   Set individual layout and variant
        gs_control-layout-cwidth_opt = abap_true.
        gs_control-layout-zebra      = abap_true.
        gs_control-layout-no_toolbar = abap_true.
        gs_control-layout-smalltitle = abap_true.
        gs_control-row-index = gd_idx.
        WRITE gd_idx TO gs_control-layout-grid_title NO-ZERO.
        CONDENSE gs_control-layout-grid_title NO-GAPS.
        CONCATENATE gs_control-layout-grid_title
                    '. Customer'
          INTO gs_control-layout-grid_title.
        CALL METHOD gs_control-grid->set_table_for_first_display
          EXPORTING
            i_structure_name = 'KNB1'
            is_layout        = gs_control-layout
            i_save           = 'A'
            is_variant       = gs_control-variant
          CHANGING
            it_outtab        = gs_control-data
          EXCEPTIONS
            OTHERS           = 4.
        IF sy-subrc <> 0.
    *     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        IF ( gd_idx > 1 ).
          CALL METHOD gs_control-grid->set_current_cell_via_id
            EXPORTING
              is_row_id = gs_control-row.
          CALL METHOD gs_control-grid->refresh_table_display
    *        EXPORTING
    *          IS_STABLE      =
    *          I_SOFT_REFRESH =
    *        EXCEPTIONS
    *          FINISHED       = 1
    *          others         = 2
          IF sy-subrc <> 0.
    *       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
        ENDIF.
        MODIFY gt_controls FROM gs_control INDEX gd_idx.
      ENDLOOP.
      gd_msg = gd_lines.
      CONDENSE gd_msg NO-GAPS.
      CONCATENATE gd_msg 'grids displayed on single screen.'
        INTO gd_msg
        SEPARATED BY space.
      MESSAGE gd_msg  TYPE 'S'.
    * Link the docking container to the target dynpro
      gd_repid = syst-repid.
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * NOTE: dynpro does not contain any elements
      CALL SCREEN '0100'.
    * Flow logic of dynpro (does not contain any dynpro elements):
    *PROCESS BEFORE OUTPUT.
    *  MODULE STATUS_0100.
    *PROCESS AFTER INPUT.
    *  MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.  " contains push button "DETAIL"
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  INIT_CONTROLS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM init_controls .
    * define local data
      DATA:
        ld_column  TYPE i,
        ls_control TYPE ty_s_control.
      REFRESH: gt_controls.
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL METHOD go_docking->set_extension( 99999 ).
    * Create splitter container
      CREATE OBJECT go_splitter
        EXPORTING
          parent            = go_docking
          rows              = p_row
          columns           = p_col
    *      NO_AUTODEF_PROGID_DYNNR =
    *      NAME              =
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      DO p_col TIMES.
        ld_column = syst-index.
        DO p_row TIMES.
    * Get cell container
          CLEAR: ls_control.
          CALL METHOD go_splitter->get_container
            EXPORTING
              row       = syst-index
              column    = ld_column
            RECEIVING
              container = ls_control-cell.
    *   Create ALV grid
          CREATE OBJECT ls_control-grid
            EXPORTING
              i_parent          = ls_control-cell
            EXCEPTIONS
              OTHERS            = 5.
          IF sy-subrc <> 0.
    *     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          APPEND ls_control TO gt_controls.
        ENDDO.  " rows
      ENDDO.  " columns
    ENDFORM.                    " INIT_CONTROLS
    Regards
      Uwe

  • Setting focus to a JTextArea using tab

    Hi,
    I have a JPanel with a lot of controls on it. When I press tab I want to
    move focus to the next focusable component. This works fine for
    JTextFields, but when the next component is a JTextArea in a
    JScrollPane then I have to press tab 3 times to set the focus to the
    JTextArea. After pressing the tab key once I think the focus is set to
    the scrollBars of the JTextArea because when I press the up and down
    arrows the textarea is scrolled.
    How can I stop the JScrollPane from getting the focus?
    I have tried to set focusable to false on the scrollPane:
    scrollPanel.setFocusable(false);
    and the scrollBars of the scrollPane:
    scrollPanel.getHorizontalScrollBar().setFocusable(false);
    scrollPanel.getVerticalScrollBar().setFocusable(false);
    But it dosen�t work. Is this a completely wrong way of doing it?
    Please help!
    I use jdk 1.4.1
    :-)Lisa

    Not sure what your problem is. The default behaviour is for focus to go directly to the JTextArea.
    import java.awt.*;
    import javax.swing.*;
    public class Test1 extends JFrame
         public Test1()
              getContentPane().add( new JTextField("focus is here"), BorderLayout.NORTH );
              getContentPane().add( new JButton("Button1") );
              getContentPane().add( new JScrollPane( new JTextArea(5, 30) ), BorderLayout.SOUTH );
         public static void main(String[] args)
              Test1 frame = new Test1();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setVisible(true);
    }

  • Problem using Setting Focus

    Hello there, can you help me on how to use the set Focus.
    For instance I have a 3 JTextField, when I run it, the focus is on the first textField, what I want is that, when I pressed the enter key on the keyBoard, the focus will be on the 2nd textField, and when I pressed again the enter key, the focus will be on the 3rd textField and so on.
    can you give me a sample code on this one, thanks.

    the last post in this thread might give you some ideas
    http://forum.java.sun.com/thread.jspa?threadID=713697&tstart=0
    note: will only work if the textfields follow each other in the focus traversal policy

  • How to set focus on a textinput/poplist using PPR

    HI,
    Is it possible to use PPR to set focus on a Text input or Poplist.
    if Yes, which attribute in the UI Item we need to use?
    will the attribute 'Access Key' work for the same?
    If PPR is not an option then getting a java bean for the UI Item is the only option?
    Thanks,
    Gowtam.

    Gowtam,
    No, the two basic differences between PPR and fire action!
    1)Fire action submit the entire OA Page Form elements, while PPR only refreshes the form components of that particular region.
    2)When PPR event is done, framework neglects any other action done on the page.
    Now, like your basic question, why should u use PPR event ?Instead y not firaction always?
    The reason is the very first defination of PPR.If i have n number of items on my page, if I define every action as fire action after each event page will refresh, so even for a small update like vanishing a field, i have to refresh the entire page which will be unusual for the user because it will take some time to load if page has some heavy components like hgrids , tables etc. Thats y we prefer PPR event over fire action in case of individual events, which is much fast, refreshing only particular form items.
    In standard j2ee web applications, the same is done using DHTML and javascript.
    I hope i am clear.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Cannot set focus when reset data using datasets

    Hi All,
    When I click reset form button. I would like to reset data then focus to the first field. I can clear information I provided but setFocus to the first name field is not working. Please help.
    I use datasets to reset data. 
    Here is my coding:
    event: click
    xfa.datasets.data.loadXML("<form1/>", true, true);
      xfa.host.setFocus("xfa.form1.contactInformation.firstname")
    Thanks,
    Cindy

    I tested the clear button. But it is not set Focus to the first field. It is not successful.

  • TextArea uses Chinese characters

    Please excuse me if the special characters appear as ?s.
    I have an application that has a TextArea component (AWT), but whenever I enter a special character using ALT+number on numeric keypad to enter a special character, it puts in Chinese characters! For example, I would usually use ALT+0225 for � and ALT+0233 for �, but I get a different Chinese character or some box character. It's different each time I type a ASCII keycode. I tried using the frame's setLocale(Locale.getDefault()) method and the TextArea's setLocale(Locale.getDefault()) method, and only the first special character I enter when the program runs appears as a normal ASCII character. I never have this problem in my dialog boxes.
    Someone please help me make a TextArea that uses ASCII special characters.

    There aren't any "ASCII special characters". What you are probably thinking of is one of those character sets that claim to be "extended ASCII", of which there are many.
    Java uses Unicode, a very extensive character set which contains ASCII as its first 127 positions. You can read about it here:
    http://www.unicode.org/
    In particular, have a look at the code charts section to find the "special characters" you are interested in entering. Then download the Character Agent program from here:
    http://www.bjondi.com/products/char_agent.db
    I assume you are a Windows user? This program is a better, Unicode, version of the little Character Map utility that comes with Windows.
    Finally, you'll need to make sure your TextArea is using a font that can render those characters you want to use.

  • How to set focus on a input field in a selected row of a table?

    In a previous discussion (http://scn.sap.com/thread/3564789) I asked how to access an input (sap.m.Input) field of a selected row in a table. In the answer that was supplied I was shown how to get the items of the table. Then using the selected index to get the selected item get the cells. Then I could set editable on the proper cell(s). This worked fine.
    Now I need to set the focus on one of the fields. I tried something like this:
                var oNewLink = table.getSelectedItem();
                var oNewLinkName = oNewLink.getCells()[1];
                oNewLinkName.focus();
    But this doesn't seem to work.
    I have searched through other discussions and have seen this technique for putting focus on a field if you have its ID:
    sap.ui.getCore().byId(id_of_the_input_field).$().focus();
    In my case though I do not have an ID since the row and its cells are generated. How can I set focus on the cell of a certain row in a table?

    Hello Venkatesh. Yes that code does work. First I tried it on a table cell that was already rendered and it did work. The next time I tried it on a table row that was being added and it did not work there. So I added an on after rendering function for the table and added that code there. That did not work until I added a delay (timeout) to do a context switch before calling the focus and that worked.
    Once last thing though sometimes when I call focus on an input field (actually in a table row cell) if the field has text in it already the flashing cursor is at the beginning of the text and other times it is at the end of the text (which is the desired way). It depends on where I click in the row. Is there anyway to make sure the flashing cursor is at the end of the text when the focus is applied to a field that contains text?

  • How to set focus on a custom PO Item screen field when in error?

    Hi All,
    I have an interesting situation that i'm wondering if others have solved.  We have extended the PO item table (EKPO) by adding two new fields.  We then have implemented two BAdI's:  ME_GUI_PO_CUST and ME_PROCESS_PO_CUST to add them to the ME21N/ME22N/ME23N screens and logic to do some validation, via these respective BAdI's mentioned.  Everything works perfectly - with one small issue.  When we are doing some validation via a method on the ME_PROCESS_PO_CUST - and "invalidate" the field (and throw an error) when it is in error - I also want to be able to "set focus" on the field in question (basically: go to the particular tab on the ME* screen and highlight the field).  I have tried using SET CURSOR FIELD *****  within this BAdI (ME_PROCESS_PO_CUST) - but doesn't seem to work.  Has anyone tried to do this and have come up with a solution?  Would be much appreciative if you shared it!!!  Thanks much.
    Cheers,
    Matt
    ERP version that we have is:  ECC 6.0

    Just have a look at oss note 310154 - ME21N/ME51N: Customer-specific check, generating error log.
    In short:
    Add your error messages in EXIT_SAPMM06E_012 (using specific macros).
    Sample code (provided in Oss note) :
      loop at tekpo where knttp eq 'X'.
        loop at tekkn where ebeln eq tekpo-ebeln and
                            ebelp eq tekpo-ebelp and
                            kostl eq space.
          if not tekkn-id is initial.
            mmpur_business_obj_id tekkn-id.
            mmpur_metafield MMMFD_ACCOUNTINGS.
          endif.
          mmpur_message_forced 'E' 'ZE' '777' '' '' '' ''.
        endloop.
      endloop.

  • Back again - set focus

    Hi again,
    I've been struggling with setting focus on each instance of a field within a repeating subform. My subform is limited to 5 instances. Min of 1.
    As the user exits the only textfield in the subform, I have a new instance creating. I want the focus set to the new instance but I have not been able to get anything to work. My latest attempt has been to try to pass a count using the instancemanager to a variable in the setfocus string.
    Here is what I have thus far. I know I need to resolve the node but that process is confusing the heck out of me. I've read and re-read everything I've been able to find but I havent been able to wrap my head around that part successfully.
    Can anyone point me in the correct direction or suggest a better solutions? TIA!
    form1.Account_Client_Information.Long_Title.Account_Long_Title::exit - (JavaScript, client)
    var oSubform = xfa.resolveNode("Long_Title");
    var oNewInstance = oSubform.instanceManager.addInstance(1);
    xfa.form.recalculate(1);
    var count = (this.instanceManager.count)
    xfa.host.messageBox("Text Field Index in new Subform: " + count);
    var vfocindex = xfa.resolveNode("Account_Long_Title[count]");
    xfa.host.setFocus(vfocindex);

    Hi,
    The addInstance method will return the subform that you want so you only need to do;
    var oNewInstance = Subform1.instanceManager.addInstance(1);
    xfa.host.setFocus(oNewInstance.Account_Long_Title)
    Regards
    Bruce

  • How to set focus in text box at server side

    Hi,
    I have small problem , i have a text box in form , which is get validated at server side in servlet , if it found some thing wrong then it throws exception , i want that when an exception is thrown it should set focus for that perticular text box. so what should i write to perform such a activity.

    Get hold of the element ID in the servlet (and keep the code conventions) and print it out to some Javascript function which does a focus during the onload.
    There's an example of focus/highlight using JSP/Servlet/Javascript in this article: [http://balusc.blogspot.com/2008/07/dao-tutorial-use-in-jspservlet.html]. Also see the screenshots at the very bottom.

  • Setting focus in a PDF form

    Hi,
    I'm trying to move a cursor to a particular field based on certain conditions using JavaScript. The method I am using is xfa.host.setFocus("fldTest"); in the initialize event. For some reason the focus isn't getting set to fldTest, but when I first hit tab it goes into the first field that is in the tab order. Is there any way around this?
    Thanks,
    Chad

    You might want to check the reference path of the field that you want to set focus on.
    Ex: xfa.host.setFocus("form1.page1.subform1.TextField1");

  • Setting focus to new instance of a field...need help.

    Hi there,
    I have a flowed form which consists of multiple subforms. I have one subform which is basically one textfield that is set to a min of 1 and a max of 5.
    These are to correspond to fields in our system of record that have 5 fields for company long name with a 36 character field limit.
    I've got the limits set up just fine and I have added simple script to add a new instance when the user exits the field.
    The focus goes to the next field set in the tab order but what I want is the focus set on the new instance of field created but I have not been able to find an example of how to do that.
    Any suggestions would be greatly appreciated. Thanks!

    Well,
    I've been reading and trying various things but cant get anything to work like I want it to.
    The sample provided works for 2 iterations but mine has to do this for up to 5 instances. I have not been able to figure out how to get this to work.
    Anyone have any additional suggestions?
    btw...here is my modified version. ES2 is whay I'm using.
    Long_Title.occur.max = "5";
    var oSubform = xfa.resolveNode("Long_Title");
    var oNewInstance = oSubform.instanceManager.addInstance(1); // I think you probably managed this first part better than here
    xfa.form.recalculate(1); // I THINK THIS IS IMPORTANT
    var count = (this.Long_Title.nodes.length)
    var testIndex = oNewInstance.Account_Long_Title.index;
    xfa.host.messageBox("Text Field Index in new Subform: " + count); // TextField1 will conserve index 0 because it is the only textfield in the new Sub1
    var NEW_TEXTFIELD = xfa.resolveNode("Long_Title[1].Account_Long_Title[0]"); // However, Sub1 gets index 1 because it is not alone any more
    xfa.host.setFocus(NEW_TEXTFIELD); // This actually sets focus on the newly created instance of TextField1 (actually Sub1 instance)

  • Setting focus to inputText of newly created row in af:table

    Using Jdev Ps4
    Simple use case:
    I have an af:table with a few columns and a createInsert button.
    When I press the createInsert button, a new record is added to the table.
    How can I set focus to the first inputText of that newly created row?
    I have been looking for a solution online but all the examples online tell us how to set focus to components that already exist and you know the ID of. With the newly created row, you don't have the ID so you cannot set the focus.
    In this topic (which is quite old...) https://kr.forums.oracle.com/forums/thread.jspa?threadID=643924 Frank Nimphius explained that it would be difficult and he would pass it on to the developers.
    I haven't found any information if there are some enhancements in this area to make this work...
    I tried with using plain old javascript by looping through the dom structure but had no success in doing so...
    Thanks
    Yannick
    Edited by: Yannick Ongena on Apr 2, 2012 8:38 AM

    Yannick,
    can you check this?
    how to get focus on newly created row in table?
    ~Abhijit

Maybe you are looking for

  • Ascii Backup: Writing block

    Hello, We are exporting data out of Hyperion Planning/Essbase into a flat text file. However we are experiencing the error: Ascii Backup: Writing block that is preventing this extraction to occur. Is anyone familiar with this error and can give me so

  • Report Builder 3.0 odbc database name using parameters

     I am using an ODBC connection for my Datasource in a report  (MYSQL). I have a valid connection for the report using a database name in the connection string  i.e. 'BOE-201402'. However I need to be able to allow the user to run the report using dif

  • SelectOneMenu/SelectItems with Date fields

    I have trying to create a list of dates (hh:mm a) using selectOneMenu and selectItems. I can get things to display fine, but when the form is submitted, I get an error message similar to: "Conversion Error setting value 'Tue Sep 21 00:00:43 CDT 2004'

  • Adding multiple plug ins in Elements 12?

    Is there a way to add all my plug ins in PSE 12?  I tried using Edit, Preferences, plugins, but it will only add one plugin.  If I add another, the first one vanishes from the Filters menu.  I tried shutting PSE down and restarting after installing t

  • FM or a BAPI to create Storage Bin

    Hi friends, Is there any Function Module  or a BAPI to create a Storage Bin???? Regards, Bhanu.