Skip to content

Commit 1551ce6

Browse files
committed
update focus handling
1 parent f4e7e41 commit 1551ce6

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

src/z2ui5_cl_demo_app_172.clas.abap

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ CLASS z2ui5_cl_demo_app_172 IMPLEMENTATION.
9595
CONCATENATE 'Link in row' lv_tab_index 'clicked' INTO lv_message SEPARATED BY space.
9696
client->message_toast_display( lv_message ).
9797

98+
* WHEN 'INPUT_CHANGE'.
99+
* client->view_model_update( ).
100+
*
101+
* RETURN.
98102

99103
WHEN 'INPUT_CHANGE'.
100104

@@ -113,6 +117,7 @@ CLASS z2ui5_cl_demo_app_172 IMPLEMENTATION.
113117

114118
ENDCASE.
115119

120+
client->follow_up_action( val = `sap.z2ui5.afterBE()` ).
116121
client->view_model_update( ).
117122

118123
ENDMETHOD.
@@ -128,14 +133,18 @@ CLASS z2ui5_cl_demo_app_172 IMPLEMENTATION.
128133

129134
DATA(page) = view->shell(
130135
)->page(
136+
id = `page`
131137
title = 'abap2UI5 - Demo ui.table'
132138
navbuttonpress = client->_event( 'BACK' )
133139
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
134140
)->header_content(
135141
)->link(
136142
)->get_parent( ).
137143

138-
DATA(table) = page->flex_box( height = '85vh' )->ui_table( alternaterowcolors = 'true' visiblerowcountmode = 'Auto'
144+
page->_generic( name = `script` ns = `html` )->_cc_plain_xml( `sap.z2ui5.afterBE = () => { setTimeout( () => { let input = document.activeElement.childNodes[0].childNodes[0].childNodes[0].childNodes[0]; input.focus( ); input.select(); } , 100 ); }`
145+
).
146+
147+
DATA(table) = page->ui_table( id = `tab` alternaterowcolors = 'true' visiblerowcountmode = 'Auto'
139148
fixedrowcount = '1' selectionmode = 'None' rows = client->_bind_edit( val = output ) ).
140149
DATA(columns) = table->ui_columns( ).
141150

@@ -156,13 +165,21 @@ CLASS z2ui5_cl_demo_app_172 IMPLEMENTATION.
156165
( `INPUT1` ) "Pass the column name as simple string to the event
157166
) ) editable = abap_true type = 'Number' ).
158167

159-
columns->ui_column( width = '8rem' sortproperty = 'INPUT2' filterproperty = 'INPUT2' )->text( text = 'Input Column' )->ui_template( )->input(
160-
value = `{INPUT2}` enabled = `{BOOL}` change = client->_event( val = 'INPUT_CHANGE' t_arg = VALUE #(
168+
columns->ui_column( width = '8rem' sortproperty = 'INPUT2' filterproperty = 'INPUT2' )->text( text = 'Input Column'
169+
)->ui_template(
170+
)->input(
171+
value = `{INPUT2}`
172+
enabled = `{BOOL}`
173+
change = client->_event( val = 'INPUT_CHANGE'
174+
t_arg = VALUE #(
161175
( `${$source>/id}` )
162176
( `${INDEX}` )
163177
( `$event.oSource.oParent.sId` )
164178
( `INPUT2` )
165-
) ) editable = abap_true type = 'Number' ).
179+
) )
180+
submit = client->_event( val = 'INPUT_SUBMIT' )
181+
editable = abap_true
182+
type = 'Number' ).
166183

167184
columns->ui_column( width = '8rem' sortproperty = 'INPUT3' filterproperty = 'INPUT3' )->text( text = 'Input Column' )->ui_template( )->input(
168185
value = `{INPUT3}` enabled = `{BOOL}` change = client->_event( val = 'INPUT_CHANGE' t_arg = VALUE #(

0 commit comments

Comments
 (0)