Request focus on view element

Hi everybody,
I have a little problem and I didn't know how to solve it. I'd like to set the cursor at any input field at my view.
I tried this like this way:
  DATA: lr_elem TYPE REF TO if_wd_view_element.
  lr_elem = view->get_element( gv_cursor ).
  view->request_focus_on_view_elem( lr_elem ).
If I start the webdynpro the cursor was set at the right position...now if I press enter or a button at the dynpro the program logic will be done and the method WDDOMODIFYVIEW will be processed again...but the cursor were not set at any field at the dynpro, why?

The following works in SP10.
I cant see what you have missed:
My test was 2 buttons, each button changes the focus to a different input field.
Attribute called FIELD was declared.
method WDDOMODIFYVIEW .
  DATA: lr_elem TYPE REF TO if_wd_view_element.
lr_elem = view->get_element( wd_this->field ).
if lr_elem is BOUND.
view->request_focus_on_view_elem( lr_elem ).
endif.
endmethod.
method ONACTIONSET_F1 .
  wd_this->field = 'F1'.
endmethod.
method ONACTIONSET_F2 .
  wd_this->field = 'F2'.
endmethod.
regards
Phil

Similar Messages

  • Request focus for message area

    Dear All,
    As my screen is long hence if an error comes we will require to scroll down so I have added a message area UI element and in do modify method of the view i have request focus to my message area but it is not working.  Below is the code which I have written:
    try{
              IWDMessageArea msgarea=(MessageArea)view.getElement("MessageArea");
            msgarea.requestFocus();
            catch(Exception e)
    Is there any other property or changes need to be made.
    Thankyou.
    Regards,
    Santosh

    Hi,
    In would say, create an input field at the top left corner of the screen. Set its width to zero and bind it to a context attribute say Va_ShowMesg of type string. Now insert a MessageArea UI element just below the inputfield to display all the erro message at the top left.
    Now if you request focus for the input field using the following code, the focus will automatically come to the Message Area as well.
    wdThis.wdGetAPI().requestFocus(wdContext.currentContextElement(),wdContext.getNodeInfo().getAttribute(
              wdContext.currentContextElement().VA__SHOW_MESG));
    You can call this code whenever you need to display message to user in the message area and shift focus of the screen to the message displayed.
    Regards,
    Tushar Sinha

  • 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 ' ).

  • Form Loads - Focus on Wrong Element

    Good day. This is a cross post but I'll try to put better detail here.
    I have a form that loads empty. I then grab data from the DB and populate the form. I have 3 radio buttons that are part of the radio group. I set one of these after gathering data by calling setSelected(true).
    The focus (rectangular dotted line) does not move to the element that is selected. I have tried requestFocus() but it does not change. The focus moves when I press tab. It seems like the focus is set to the first focusable element.
    What do I need to do to solve this? Should I try changing the order of focusable elements to have my selected item as the first element?
    BTW - I have also tried the following to correct this.
    doClick()
    grabFocus()
    Thanks

    OK. I am now working woth a non modal dialog. I do the following.
    Construct
    Show
    Call DB
    Update radio button
    request focus for the selected button
    The first button (non selected) is still focused.
    Help please?

  • How to find out which context attributes are mapped to view elements

    Hi All,
    We have a custom WD application ( on ECC 6.0 - SAP Basis 70 ) where we have a context node whose 70 attributes are displayed over 2 seperate views.
    When a user enters the view,  we want to inform him which data was changed. 
    I have written a general method which takes the context node, grabs its attributes and compares values ... messages are generated via the message manager and context element/attributes are linked so that the input elements become red.
    Everything works fine but the only problem is that I do not know which attributes are visible on which view so the user is getting the changes of view 2 on view 1 and vice versa ( if the context is only mapped on 1 view then there is no issue ofcourse ).
    The call is currenlty executed at the views inbound plug ... I also checked the view methods themselves like modify view but nothing seems to lead me to a potential solution ...
    I have looked through almost all API classes available but I cannot find any way to obtain information about the linking of view elements with context elements/attributes during runtime ... And I don't want to 'hardcode' a list of context attributes per view ....
    Has anyone done something similar ?
    Thanks,
    Steven

    Hi All,
    We have a custom WD application ( on ECC 6.0 - SAP Basis 70 ) where we have a context node whose 70 attributes are displayed over 2 seperate views.
    When a user enters the view,  we want to inform him which data was changed. 
    I have written a general method which takes the context node, grabs its attributes and compares values ... messages are generated via the message manager and context element/attributes are linked so that the input elements become red.
    Everything works fine but the only problem is that I do not know which attributes are visible on which view so the user is getting the changes of view 2 on view 1 and vice versa ( if the context is only mapped on 1 view then there is no issue ofcourse ).
    The call is currenlty executed at the views inbound plug ... I also checked the view methods themselves like modify view but nothing seems to lead me to a potential solution ...
    I have looked through almost all API classes available but I cannot find any way to obtain information about the linking of view elements with context elements/attributes during runtime ... And I don't want to 'hardcode' a list of context attributes per view ....
    Has anyone done something similar ?
    Thanks,
    Steven

  • The requested URL /discoverer/viewer was not found on this server

    hi
    In e-business suite 12.1.1 , In projects super user responsibility when I want to open JSP forms like :
    Team Role Details Workbook and Overcommitted Resource Hours Workbook and Scheduled Resource Hours Workbook This error take place :
    Not Found
    The requested URL /discoverer/viewer was not found on this server.
    i think this is not related to Oracle Projects, i think it should solve by It.
    can any body tell me what should i do???

    M.Khayatan wrote:
    hi
    In e-business suite 12.1.1 , In projects super user responsibility when I want to open JSP forms like :
    Team Role Details Workbook and Overcommitted Resource Hours Workbook and Scheduled Resource Hours Workbook This error take place :
    Not Found
    The requested URL /discoverer/viewer was not found on this server.
    i think this is not related to Oracle Projects, i think it should solve by It.
    can any body tell me what should i do???Do you get this error with this specific page only?
    Please see these docs.
    11i: "NOT FOUND The requested URL /discoverer/viewer was not found on this server" Error When Attempting To Open Workbook From Apps Menu [ID 1327364.1]
    How to Create a Link to a Discoverer Workbook in Apps R12 [ID 471303.1]
    Using Discoverer 11.1.1 with Oracle E-Business Suite Release 12 [ID 1074326.1]
    Using Discoverer 10.1.2 with Oracle E-Business Suite Release 12 [ID 373634.1]
    Thanks,
    Hussein

  • Problem with requesting focus for a list

    Hi there !
    What would be the right way to request focus for a list component ?
    I can use select() method to select some item from a list, but the list itself still hasn't got a focus until I click it.
    What I'd like to do is to be able to highlight some item from the list by using up and down arrow keys only, without clicking the list first =)

    The list is visible, but still this doesn't work.
    I think that the reason for this may be that I'm running this app on Nokia 9210 Communicator emulator. The emulator itself has had some not-so-minor problems...

  • Call sap transaction in view element

    Hi together,
    I'm a WD beginner.
    So I want to know how can I start/show a sap Transaction in a UIElment. I don't want to start an external window.
    I searched a Long time here in SCN. Some guys said it is not possible  ?!?!?!
    Thanks a lot
    Wolfgang
    PS: I want to create a tabstrip element. In one Tabstrib I want put a view element in it. In this element I want to Show a Special SAP Standard Transaction to Show data. The Transactions runs if I create a new window. BUt we think it's not user friendly to create a new view.

    Hi Steffen,
    You can achieve your requirement as below
    Create an ui element  "IFRAME" inside the tab and bind the source to a context attribute URL
    Generate the URL for your t-code and set the value to context attribute URL
    You can refer my answer in the below link
    ITS server in ABAP Webdynpro
    Hope this helps you.
    Regards,
    Rama

  • View Element with ID _CFG_GROUP_36_CAPTION in View V_PREVIEW Already Exists

    Dear All,
    In EHP5 'Personal profile' Service, I was trying to modify the detailed screen of Address Information for Great Britain through FPM configurator. On the default detailed screen for this country, there was one group called 'Communication' . I wanted to hide that group. I thought I can achieve this by modifying attribute of this group. There were two attributes 'sequence Index' and 'Column' which decides position of specific group on detailed screen. I made value against these attributes as 0. But after doing these changes I am not able to see the preview of this detailed screen. It is throwing following runtime error:
    View Element with ID CFGGROUP_36_CAPTION in View V_PREVIEW Already Exists.
    How to revert the changes made in the attribute of this group.
    Regards,
    Swapnali

    check these steps
    1. Customizing the Fields in Overview Screens
    http://help.sap.com/erp2005_ehp_05/helpdata/en/77/804c18e1844944b7f8baf5
    3159be78/content.htm
    2. Configuration of Personal Profile Services
    http://help.sap.com/erp2005_ehp_05/helpdata/en/3a/fe6eac579d4a9ead651d77
    9a2dbd23/content.htm
    3. Personal Profile application Documentation
    http://help.sap.com/erp2005_ehp_05/helpdata/en/14/60cd56b1514ae5aa811d2a
    a4a59de3/content.htm
    In EhP5 ESS Personal Profile application, in order to change the
    Address overview page fields, you need to adapt the Address component
    configuration HRESS_CC_PER_OVR_ADDRESS_XX.
    Note: In EhP5, ESS screens are based on Floor Plan Manager for
    WebDynpro ABAP Generic UI Building Block concept. To configure
    overview page fields we no longer use 'Determine Fields for Business
    Card on Area Page' View instead of that we adapt the FPM configurations.
    In the standard delivery in the Overview Page, always international
    Address is displayed and in the edit screen based on the country
    selection (Foreign Address scenario), corresponding country screens
    are displayed.
    Note: We always show international address screen in overview page in
    order to support Foreign Address scenario.
    If you want to chanage the fields in the Address overview page fields
    then adapt the Address component configuration

  • HTTPService request for each View inside a ViewStack

    Can someone point me in the right direction to have a
    httpservice request for each view inside my viewstack?
    <mx:ViewStack id="views">
    <mx:Canvas id="view0">
    </mx:Canvas>
    <mx:Canvas id="view1">
    </mx:Canvas>
    </mx:ViewStack>
    Can someone whip together a quick example or just point me in
    the right direction?
    Thanks

    Ahh, don't do that.
    Use a central HTTPService instance, and use AsyncToken to
    keep track of which result goes where. Some code snippets below.
    Tracy
    Sample code using HTTPService, e4x, handler function to
    populate a list item.
    Also shows usage of AsyncToken.
    The DataGrid tag:
    <mx:DataGrid id="dg" dataProvider="{_xlcMyListData}"
    .../>
    The HTTPService tag:
    <mx:HTTPService id="service" resultFormat="e4x"
    result="onResult(event)" fault="..../>
    Script block declaration:
    import mx.rpc.Events.ResultEvent;
    [Bindable]private var _xlcMyListData:XMLListCollection;
    Invoke send:
    var oRequest:Object = new Object();
    oRequest.Arg1 = "value1";
    var callToken:AsyncToken = service.send(oRequest);
    token.callId = "myQuery1";
    Result Handler function:
    private function onResult(oEvent:ResultEvent):void {
    var xmlResult:XML = XML(event.result); //converts result
    Object to XML. can also use "as" operator
    var xlMyListData:XMLList = xmlResult.myListData; //depends
    on xml format, is row data
    _xlcMyListData = new XMLListCollection(xlMyListData); //wrap
    the XMLList in a collection
    trace(_xlcMyListData.toXMLString()); //so you can see
    exactly how to specify dataField or build labelFunction
    var callToken:AsyncToken = oEvent.token;
    var sCallId = callToken.callId; //"myQuery1"
    switch(sCallId) {
    case "myQuery1":
    doQuery2();
    break;
    }//onResult

  • How  to set focus on an element inside a datatable on load

    How to set focus on an element inside a datatable on load

    Check out https://blogs.oracle.com/groundside/entry/ever_wondered_how_uncommitteddatawarning_works and
    Decompiling ADF Binaries: Checking for dirty data
    Timo

  • Is it possible to do focus stacking in elements 11

    Is it possible to do focus stacking in elements 11 and how do i do it ?

    Hi marcuso46392578,
    Please find this video for focus stacking:
    Focus Stacking in Photoshop Elements - YouTube
    You can also see this blog: Focus Stacking in PSE 11/12 - Elements Village
    Regards,
    Sandeep

  • Requesting focus for JTextField inside JPanel

    I have an application with following containment hierarchy.
    JFrame --> JSplitPane --> JPanel.
    JPanel is itself a seperate class in a seperate file. I want to give focus to one of the JTextfields in JPanel, when the JPanel is intially loaded in the JFrame. I believe that I cannot request focus until the JPanel is constructed. I can set the focus from JFrame (which loads JPanel) but I want to do this from JPanel. Is there any technique to request focus from the JPanel itself (preferably during JPanel construction).
    regards,
    Nirvan.

    I believe that I cannot request focus until the JPanel is constructedYou can't request focus until the frame containing the panel is visible. You can use a WindowListener and handle the windowOpened event.

  • Reading URL parameter & displaying into view element

    Dear All,
    I have designed a ABAP webdynpro application.
    With one parameter in application so that I can pass data to webdynpro to views elements.
    Can any one help how to pass data from URL additional parameters to Views context elements?
    For Example:
    WebDynpro Application URL: http://XXXX.com:YYYY/sap/bc/webdynpro/sap/zumruf4?zdata=909090
    So Can I display parameter zdata '909090' to main view?
    Thanks

    ..

  • Can you make a HTTP GET request with JSC form element?

    It seems the form element in JSC make a HTTP POST request by default, but is it possible to make a HTTP GET request by the form element in JSC?
    (It is worth to mention here that HTTP GET request has its distinctive advantages like you can embed the parameters in a URL and bookmark it)
    Thank you very much.

    Jim,
    I am doing the sameway as you suggested to MISS_DUKE
    But have you face any problems in doing so? In otherwords its the page rendering correctly?
    On requesting the same page multiple times, Every time I get the page that was rendered for the first time.
    To see the correct results, I need to close the browser and check it .
    see my previous queries here
    http://swforum.sun.com/jive/thread.jspa?threadID=54379&messageID=208223#208223
    http://swforum.sun.com/jive/thread.jspa?threadID=56440&messageID=214302#214302
    http://swforum.sun.com/jive/thread.jspa?threadID=56676&messageID=214987#214987
    http://swforum.sun.com/jive/thread.jspa?threadID=56390&messageID=214139#214139
    And I am still expecting the answer from experts. But nobody turn arround
    Thanks,
    Sudhakar

Maybe you are looking for

  • Possible to ssh tunnel Bonjour traffic across different subnets?

    Hello: For quite some time, I have been thinking of buying a couple of iSights to enable audio/visual between two distant computers. But I really don't want to have to leave a dozen ports in my DSL modems opened up in order to use AIM or Jabber serve

  • I do not want them to download it

    Hi, I have posted a quicktime movie on one of my web pages. I posted it to let my boss view it and give me a feedback. The problem is that he was able to download it. Well, as I want to post an other video, and I do not want anybody be able to downlo

  • Line Graph Behaviour

    I have a series of data 01-JAN-2008 10 01-FEB-2008 20 01-MAR-2008 30 01-DEC-08 30 and some data for 2009 01-JAN-2009 5 01-FEB-2009 10 01-MAR-2009 20 01-APR-2009 30 I am trying to produce a rolling 12 month Graph with the Month as the label and Year a

  • When I try and download an app (iphone 4s) , from the app store a message pops up saying "Not connected to the intunes store

    When I try and download an app , from the app store a message pops up saying "Not connected to the intunes store".

  • CKMDUVMAT posting date restriction

    Hi gurús. We us succesfullly CKMDUVMAT but we want to find the way to post adjustments done in any date of the period in all consumptions ot the same period. We want to know if is possible to post this stocks adjustment to subcontracting consumptions