Skip to content

update odata samples #455

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 1 commit into from
Dec 8, 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
73 changes: 35 additions & 38 deletions src/z2ui5_cl_demo_app_314.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ CLASS z2ui5_cl_demo_app_314 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.


TYPES:
BEGIN OF ty_row,
count TYPE i,
Expand All @@ -17,7 +16,7 @@ CLASS z2ui5_cl_demo_app_314 DEFINITION PUBLIC.
END OF ty_row.
DATA t_tab TYPE STANDARD TABLE OF ty_row WITH EMPTY KEY.

data mv_val type string.
DATA mv_val TYPE string.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
Expand All @@ -30,58 +29,56 @@ CLASS z2ui5_cl_demo_app_314 IMPLEMENTATION.

IF client->check_on_init( ).

DO 10 TIMES.
DATA ls_row TYPE ty_row.
ls_row-count = sy-index.
ls_row-value = 'red'.
ls_row-descr = 'this is a description'.
ls_row-checkbox = abap_true.
ls_row-valuecolor = `Good`.
INSERT ls_row INTO TABLE t_tab.
ENDDO.
DO 10 TIMES.
DATA ls_row TYPE ty_row.
ls_row-count = sy-index.
ls_row-value = 'red'.
ls_row-descr = 'this is a description'.
ls_row-checkbox = abap_true.
ls_row-valuecolor = `Good`.
INSERT ls_row INTO TABLE t_tab.
ENDDO.

DATA(view) = z2ui5_cl_xml_view=>factory( ).
DATA(page) = view->shell(
)->page(
title = 'abap2UI5 - Table with odata source'
title = 'abap2UI5 - Device Model, HTTP Model, OData Model'
navbuttonpress = client->_event( 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).

page->input( description = `device model` value = `{device>/resize/width}` enabled = abap_false ).

mv_val = `input value with http model`.
page->input( client->_bind_edit( val = mv_val switchdefaultmodel = abap_true ) ).

page->input( description = `device model` value = `{device>/resize/width}` enabled = abap_false ).

mv_val = `input value with http model`.
page->input( client->_bind_edit( val = mv_val switchdefaultmodel = abap_true ) ).
DATA(tab) = page->table( client->_bind_edit( val = t_tab switchdefaultmodel = abap_true ) ).

DATA(tab) = page->table( client->_bind_edit( val = t_tab switchdefaultmodel = abap_true ) ).

tab->header_toolbar(
)->toolbar(
)->title( 'table with http model (framework default)' ).
tab->header_toolbar(
)->toolbar(
)->title( 'table with http model (framework default)' ).

tab->columns(
)->column(
)->text( 'Value' )->get_parent(
)->column(
)->text( 'Info' )->get_parent(
)->column(
)->text( 'Description' )->get_parent( ).
tab->columns(
)->column(
)->text( 'Value' )->get_parent(
)->column(
)->text( 'Info' )->get_parent(
)->column(
)->text( 'Description' )->get_parent( ).

tab->items( )->column_list_item( )->cells(
)->text( '{http>VALUE}'
)->text( '{http>INFO}'
)->text( '{http>DESCR}').
tab->items( )->column_list_item( )->cells(
)->text( '{http>VALUE}'
)->text( '{http>INFO}'
)->text( '{http>DESCR}').


tab = page->table(
items = `{/BookingSupplement}`
growing = abap_true
).
tab = page->table(
items = `{/BookingSupplement}`
growing = abap_true
).

tab->header_toolbar(
tab->header_toolbar(
)->toolbar(
)->title( 'table with odata model' ).
)->title( 'table with odata model' ).

tab->columns(
)->column( )->text( 'TravelID' )->get_parent(
Expand Down
15 changes: 0 additions & 15 deletions src/z2ui5_cl_demo_app_315.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,6 @@ CLASS z2ui5_cl_demo_app_315 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.


TYPES:
BEGIN OF ty_row,
count TYPE i,
value TYPE string,
descr TYPE string,
icon TYPE string,
info TYPE string,
checkbox TYPE abap_bool,
percentage TYPE p LENGTH 5 DECIMALS 2,
valuecolor TYPE string,
END OF ty_row.
DATA t_tab TYPE STANDARD TABLE OF ty_row WITH EMPTY KEY.

data mv_val type string.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
Expand Down
Loading