How to set focus on invisible input field?

Hi Guys,
I need an invisible input field and have to set an input focus on it. My problem is that if I set input field’s property visible=blank, I get my invisible field <b>BUT</b> the function call doesn’t work (setInput.requestFocus()).
I suppose that I can’t set a focus if an input field is invisible.
Does somebody know how can I solve my problem? Is there a possibility to do this input field invisible with java script? If yes, how does it work in Web Dynpro?
Thanks
Marita

Hi
  Setting a focus on invisible input field will not work even if you follow the method what sowjanya has suggested. The method wdThis.wdGetAPI().requestFocus() will not work for read-only and disabled fields.
By the way why do you want to set the focus on a invisible input field. If you can tell us the requirement maybe we could think of an alternate solution. But i guess for the current scenario setting focus on invisible input field does not work.
regards
ravi

Similar Messages

  • How to set focus on an input field by coding?

    Dear friends,
    Do you have such experience if we can set focus on an input field by code?
    Thanks and best regards,
    Anders

    Hi,
    There are two ways to set the focus of an inputfield.
    1) In the BSP page add the attribute focus to an inputfield and set it to true.
    Ex: <thtmlb:inputField id = "test"
                          focus = "TRUE"/>
    2) Using the P-getter in the case where the inputfield is created using the config tool.
    Ex: CASE iv_property.
    WHEN if_bsp_wd_model_setter_getter=>fp_focus.
    rv_value = abap_true.
    ENDCASE.
    regards,
    MuralidharPrasad.C

  • 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 specific search field in FPM's search guibb?

    Is there any way to set the input focus to a specifc search field in an FPM's search guibb? I found that there is a godd way for forms by using the IO_EXTENDED_CTRL object in the GET_DATA function. But it seems that there is no corresponding way to do for search forms. Any other idea?
    Best regards,
    Thomas

    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 default value to input field dynamically

    Hello Experts,
    I am using adobe forms inside Webdynpro Java.
    Adobe form is having few input fields where at run time i want to assign default value to those fields.
    How can i do it ?
    Thanks in advance,
    Vinay
    Edited by: VINAY on Feb 24, 2011 6:39 AM

    Hi Mate,
    Just set the value to the webdynpro context fields on view init.
    if its like that will override the values entered by use on the form.
    just check if the default value is equall to the field value if yes leave it, if not dont touch that field.
    does this make sense...?
    Cheers,
    Sai

  • How to set cureent date as input field in alv

    Hi Experts
        I have created an Alv report.In that report i have an input field Created Date.
        how to set the current date default in the alv input.Plz guide

    Hi ,
    In the internal table declare a field of type D and pass the sy-datum.  this will solve ur problem.
    Hope information shall be useful.
    Regards
    Santosh Kumaar.M

  • How to set default value to input field

    Hi Experts,
    I need to set default value to one input field for the transaction crmd_order as a screen variant. Guide me in doing that.
    Regards,
    Harish

    Using the transaction SHD0, you can define the screen variant. While defining the sceen variant, you are allowed to define the default values.
    Using screen variant, for the main transactoin, you can also define the transaction variant and you can use this as an independent transaction.

  • How  to set focus on next row inputfield in table

    Hello all,
    How  to set focus on next row input field in table
    Please help.
    Thanks in advance.
    CSP

    Hi,
    use the following code
    wdThis.wdGetAPI().requestFocus(nodeElement, attribute)
    Ex:
    Provide the attribute and replace the nodeElement with that of yours
    IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute("Your attribute");
           wdThis.wdGetAPI().requestFocus(wdContext.currentContextElement(), attributeInfo);
    Regards
    Ayyapparaj

  • How to set focus on UI Element

    Hi All,
    I am using the below code to set the focus on the first row of the table given in the link  [How to set focus at UI element ? ] on enter of an event.
    data: lr_elem type ref to if_wd_view_element.
    lr_elem = view->get_element( <ID of the Link to Action field>).
    if lr_elem is bound.
    view->request_focus_on_view_elem( lr_elem ).
    endif.
    I am getting "Cannot use NULL reference as object error at view".
    Can you please tell me how to get the reference of the "view".
    Thanks
    Praveen

    >
    praveenkumar_81 wrote:
    > Hi All,
    >
    > I am using the below code to set the focus on the first row of the table given in the link  [How to set focus at UI element ? ] on enter of an event.
    >
    >
    data: lr_elem type ref to if_wd_view_element.
    > lr_elem = view->get_element( <ID of the Link to Action field>).
    >
    > if lr_elem is bound.
    > view->request_focus_on_view_elem( lr_elem ).
    > endif.
    >
    > I am getting "Cannot use NULL reference as object error at view".
    >
    > Can you please tell me how to get the reference of the "view".
    >
    > Thanks
    > Praveen
    Hallo Praveen,
    have you controlled that id of the Linktoaction ? there you made error.
    See it in the ViewElement designer .
    should be something like this
    lr_elem = view->get_element( 'LTA_name ' ).

  • How to restrict the length of input field

    Hi,
    How to restrict the length of input field. That is we should not be able to enter more thatn 10 charecters.
    Regards,
    H.V.Swathi

    Hi swathi,
    For this you have to create a simple data type. No need of writing a code.
    Go to Dictionaries -> Local Dictionary -> Data Type - > Simple Type - > Right click and "Create Simple Type".
    Here you should create a Simple type with String as built-in Type. Here you will also see the Length Constraints option.
    Set the value of maximum length and minimum length. In your case set the value of maximum length to 10. At runtime this will not allow the user to enter more than 10 characters.
    Now create an attribute and bind it to this newly created simple type. Bind the value of the input field with this particular attribute.
    Regards
    Manohar

  • How to do ICON_EXPAND and ICON_COLLAPSE input fields in module pool screen?

    hi frnds.
    My problem is in module pool screen how to do ICON_EXPAND and ICON_COLLAPSE input fields in module pool screen?And how to do GUI STATUS and GUI TITLE? IN SE80.
      ITS URGENT.POINTS WILL BE REWADED.THANKS  IN ADVANCE.

    Hi,
    Go through this thread.
    [expand and collapse|expand and collapse]
    Cheers,
    Simha.

  • How to prepopulate value in webapps input fields or for any custom fields in for any other forms?

    How to prepopulate value in webapps input fields or for any custom fields in for any other forms?

    What do you want to populate the form with?

  • How to set white spaces between the fields in dataset??

    Hi all,
    I am writing a set on information to from infotypes to a text file. Its a fixed width file. How do set white spaces in the fields for dataset?
    Example:
    TYPES: begin of header,
                    filler(40)  type c,
                    id(3)        type c,
                    filler2(7) type  c,
                    delimiter  type  c,
                 end of header.
    DATA header type header.
    header-filler1 = ' '.
    header-id       = '100'.
    header-filler2 = ' '.
    header-delimiter = cl_abap_char_utilities=>newline.   ( do it to get a new line)
    my_table = header.
    append my_table.
    DATA: out_file(256) type C,
          codepage_ref type ref to CX_SY_CONVERSION_CODEPAGE,
          out_char type c,
          size type i,
          insert_string type string,
          insert_size type i.
      out_file = filename.
      open dataset out_file for output in text mode ENCODING NON-UNICODE.
      LOOP AT my_table.
        size = strlen( my_table ).
        insert_string = ''.
        DO size TIMES.
          offset = sy-index - 1.
          try.
              out_char = my_table+offset(1).
              IF out_char = SPACE.
                CONCATENATE insert_string '' INTO insert_string SEPARATED BY SPACE.
              ELSE.
                CONCATENATE insert_string out_char INTO insert_string.
                transfer insert_string to out_file NO END OF LINE .
                insert_string = ''.
              ENDIF.
            catch CX_SY_CONVERSION_CODEPAGE.
              insert_size = strlen( insert_string ) - 1.
              insert_string = insert_string(insert_size).
          endtry.
        ENDDO.
       transfer CL_ABAP_CHAR_UTILITIES=>NEWLINE TO out_file NO END OF LINE.
      ENDLOOP.
      close dataset out_file.
    How do I get to insert the space for filler1 and filler2?
    Edited by: Siong Chao on Oct 4, 2011 4:56 AM
    Edited by: Siong Chao on Oct 4, 2011 8:27 AM
    Edited by: Siong Chao on Oct 4, 2011 8:29 AM

    problem lies in the open dataset codes
    Used:
    open dataset out_file for output in text mode encoding non-unicode message msg.
    if sy-subrc= 0.
    loop at my_table.
    transfer my_table to out_file
    transfer cl_abap_char_utilities=>newline to out_file no end of line.
    endloop.

  • How to set a layer invisible?

    Hi guys,
    Can you tell me how to set a layer invisible? Thanks.

    function hideAllLayers()<br />{<br />     forEach(document.layers, function(layer) {<br />          layer.visible = false;<br />     });<br />}<br /><br />function showAllLayers()<br />{<br />     forEach(document.layers, function(layer) {<br />          layer.visible = true;<br />     });          <br />}<br /><br />function forEach(collection, fn)<br />{<br />     var n = collection.length;<br />     for(var i=0; i<n; ++i)<br />     {<br />          fn(collection[i]);<br />     }<br />}

  • How to set focus order of multiple Component in a Frame

    I have created a Frame with contain some Label, Textfield, Choice and Buttons
    How do set focus order on these Components

    write an implementation of
    import java.awt.*;
    public class PanelFocusTraversalPolicy extends FocusTraversalPolicy
        public Component getComponentAfter(Container container, Component component)
            if(component.equals(cmp1))
                return cmp2;
            if(component.equals(cmp2))
                return cmp3;
            return cmp1;
        public Component getComponentBefore(Container container, Component component)
            //implentation of method
        public Component getDefaultComponent(Container container)
          return cmp1;
        public Component getLastComponent(Container container)
            return cmp3;
        public Component getFirstComponent(Container container)
           return cmp1;
        public PanelFocusTraversalPolicy()
    }and set the focus traversal of frame.
    setFocusTraversalPolicy(new PanelFocusTraversalPolicy())

Maybe you are looking for