Skip to content

Focus demo #203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/z2ui5_cl_demo_app_000.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
).

panel->generic_tile(
header = 'Focus II'
press = client->_event( 'z2ui5_cl_demo_app_189' )
mode = 'LineMode'
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
).

panel->generic_tile(
header = 'Scrolling'
press = client->_event( 'Z2UI5_CL_DEMO_APP_134' )
Expand Down
16 changes: 11 additions & 5 deletions src/z2ui5_cl_demo_app_188.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ CLASS z2ui5_cl_demo_app_188 DEFINITION PUBLIC.
ENDCLASS.


CLASS z2ui5_cl_demo_app_188 IMPLEMENTATION.

CLASS Z2UI5_CL_DEMO_APP_188 IMPLEMENTATION.


METHOD z2ui5_if_app~main.
IF check_initialized = abap_false.
check_initialized = abap_true.
Expand All @@ -21,10 +24,13 @@ CLASS z2ui5_cl_demo_app_188 IMPLEMENTATION.
client->message_box_display( `No Launchpad Active, Sample not working!` ).
ENDIF.

DATA(view) = z2ui5_cl_xml_view=>factory( ).
DATA(page) = view->shell( )->page( showheader = abap_false ).

page->_z2ui5( )->lp_title( client->_bind_edit( mv_title ) ).
DATA(shell) = z2ui5_cl_xml_view=>factory( )->shell( ).
IF client->get( )-check_launchpad_active = abap_true.
DATA(page) = shell->page( showheader = abap_false ).
page->_z2ui5( )->lp_title( client->_bind_edit( mv_title ) ).
ELSE.
page = shell->page( title = client->_bind_edit( mv_title ) ).
ENDIF.

client->view_display( page->simple_form( title = 'Set Launchpad Title Dynamically' editable = abap_true
)->content( 'form'
Expand Down
75 changes: 75 additions & 0 deletions src/z2ui5_cl_demo_app_189.clas.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
CLASS z2ui5_cl_demo_app_189 DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .

PUBLIC SECTION.
INTERFACES:
z2ui5_if_app.

DATA:
one TYPE string,
two TYPE string,
three TYPE string,
focus_field TYPE string.

PRIVATE SECTION.
DATA initialized TYPE abap_bool.
DATA client TYPE REF TO z2ui5_if_client.

METHODS render.
METHODS dispatch.

ENDCLASS.


CLASS z2ui5_cl_demo_app_189 IMPLEMENTATION.

METHOD dispatch.

CASE client->get( )-event.
WHEN 'one_enter'.
focus_field = 'IdTwo'.
WHEN 'two_enter'.
focus_field = 'IdThree'.
ENDCASE.
client->view_model_update( ).

ENDMETHOD.


METHOD render.

DATA(page) = z2ui5_cl_xml_view=>factory(
)->shell(
)->page( ).

page->simple_form(
)->content( ns = 'form'
)->label( 'One' )->input( id = 'IdOne' value = client->_bind_edit( one ) submit = client->_event( 'one_enter' )
)->label( 'Two' )->input( id = 'IdTwo' value = client->_bind_edit( two ) submit = client->_event( 'two_enter' )
)->label( 'Three' )->input( id = 'IdThree' value = client->_bind_edit( three )
).

page->_z2ui5( )->focus( focusid = client->_bind( focus_field ) ).

client->view_display( page->stringify( ) ).

ENDMETHOD.


METHOD z2ui5_if_app~main.

me->client = client.

IF initialized = abap_false.
initialized = abap_true.
focus_field = 'IdOne'.
render( ).
ENDIF.

dispatch( ).

ENDMETHOD.
ENDCLASS.

16 changes: 16 additions & 0 deletions src/z2ui5_cl_demo_app_189.clas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_DEMO_APP_189</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>focus</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>