Update control.md (#330)

* Update control.md

* update

* controls

* update controls
This commit is contained in:
oblomov 2023-07-01 11:27:28 +02:00 committed by GitHub
parent cd6ef63cf0
commit 8dd5b09576
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 3 deletions

View File

@ -0,0 +1,18 @@
_Every help and PR extending abap2UI5 with additional UI5 controls is welcome!_
If you create a view and you miss a specific UI5 control, you can extend the class z2ui5_cl_xml_view. It is an ABAP copy of the UI5 API. Just add a new method named by the control and add its attributes as importing parameters. Do the following:
**(0) Analyse the UI5 API for the Control you want to add:**
Read the [following issue ](https://github.com/abap2UI5/abap2UI5/issues/248) to understand the UI5 API. <br>
**(1) Check the name, properties and events of the new control:**
<img width="500" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/18bae1ee-862e-40ed-9209-416831ae09d6">
(for example sap.m.Button)<br>
**(2) Create a new method in the class z2ui5_cl_xml_view named by the control and add all properties you need:**
<img width="500" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/743b19aa-5c03-4f01-abb7-657df802ce56">
(use always optional and type clike)<br>
**(3) Add the implementation:**
<img width="500" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/dfe0f472-e4e3-4462-b408-4f42f4ecaeef">
(wrap boolean properties with the utility class) <br>
**(7) Contribute your change by opening a PR.**
**Thank you for your help!**

View File

@ -311,6 +311,8 @@ CLASS z2ui5_cl_xml_view DEFINITION
class TYPE clike OPTIONAL
visible TYPE clike OPTIONAL
submit TYPE clike OPTIONAL
valueLiveUpdate TYPE clike OPTIONAL
autocomplete TYPE clike OPTIONAL
PREFERRED PARAMETER value
RETURNING VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
@ -496,6 +498,7 @@ CLASS z2ui5_cl_xml_view DEFINITION
id TYPE clike OPTIONAL
change TYPE clike OPTIONAL
liveChange TYPE clike OPTIONAL
autocomplete TYPE clike OPTIONAL
RETURNING VALUE(result) TYPE REF TO z2ui5_cl_xml_view.
METHODS message_view
@ -926,7 +929,6 @@ CLASS z2ui5_cl_xml_view DEFINITION
!visiblerowcount TYPE clike OPTIONAL
!visiblerowcountmode TYPE clike OPTIONAL
!alternaterowcolors TYPE clike OPTIONAL
!with TYPE clike OPTIONAL
!footer TYPE clike OPTIONAL
!filter TYPE clike OPTIONAL
!sort TYPE clike OPTIONAL
@ -1649,7 +1651,9 @@ CLASS z2ui5_cl_xml_view IMPLEMENTATION.
( n = `suggestionRows` v = suggestionrows )
( n = `showSuggestion` v = lcl_utility=>get_json_boolean( showsuggestion ) )
( n = `valueHelpRequest` v = valuehelprequest )
( n = `submit` v = submit )
( n = `autocomplete` v = lcl_utility=>get_json_boolean( autocomplete ) )
( n = `valueLiveUpdate` v = lcl_utility=>get_json_boolean( valueLiveUpdate ) )
( n = `submit` v = lcl_utility=>get_json_boolean( submit ) )
( n = `showValueHelp` v = lcl_utility=>get_json_boolean( showvaluehelp ) )
( n = `class` v = class ) ) ).
ENDMETHOD.
@ -2060,6 +2064,7 @@ CLASS z2ui5_cl_xml_view IMPLEMENTATION.
( n = `value` v = value )
( n = `id` v = id )
( n = `change` v = change )
( n = `autocomplete` v = lcl_utility=>get_json_boolean( autocomplete ) )
( n = `liveChange` v = liveChange ) ) ).
ENDMETHOD.
@ -2423,13 +2428,13 @@ CLASS z2ui5_cl_xml_view IMPLEMENTATION.
( n = `threshold` v = threshold )
( n = `visibleRowCount` v = visibleRowCount )
( n = `visibleRowCountMode` v = visibleRowCountMode )
( n = `with` v = with )
( n = `footer` v = footer )
( n = `filter` v = filter )
( n = `sort` v = sort )
( n = `customFilter` v = customFilter )
( n = `rowSelectionChange` v = rowSelectionChange )
) ).
ENDMETHOD.