cancel
Showing results for 
Search instead for 
Did you mean: 

Focusfield

former_member188973
Participant
0 Kudos

Hey Experts,

can anybody give me a hint how the ~focusfield in HTMLB works:


<body class="MobileBody" onload="setFocus('`~focusfield`')" onkeydown="return processKeyEvent(event);" onhelp="return false;">
        <form method="post" action="`WGateURL()`" name="mobileform" onsubmit="return firstSend()" style="display:inline">
            <!-- hidden okcode field -->
            <INPUT type="hidden" name="~OkCode" value="/0">
            <!-- hidden fkey field -->
            <INPUT type="hidden" name="~FKey" value="">
            <!-- hidden focus field -->
            <INPUT type="hidden" name="~Focusfield" value="/0">
            <!-- already send flag -->
            <INPUT type="hidden" name="~ItsMobFirstSend" value="">

This is what the generator does. But how do I set the focus to an input field?

What does the hidden fields do?

Is there a way to set the focus in the IAC on the same field as in the Dynpro-Transaction?

Kind regards

Roman

Accepted Solutions (1)

Accepted Solutions (1)

former_member228142
Active Contributor
0 Kudos

Hi Roman,

if you do a SET CURSOR FIELD myfield in the ABAP, the ITSmobile framework sets the focus to myfield using the ~focusfield variable in the browser. ~focusfield just contains the name of the field which has the focus. On the other hand ~focusfield is used to transport the input field which currently has the focus back to the ABAP for i.e. GET CURSOR FIELD myfield. Basically you should have to do nothing special. ITSmobile just do it for you. Recently we fixed bugs in the focus handling. SAP note 1031074 contains the precorrections.

Best regards,

Klaus

P.S. If you use namespaces in fieldnames like /swcm/<fieldname> you have to apply the kernel patch from SAP note 1060796

Answers (0)