bugfix nested view (#410)

* docu update

* bugfix nested views
This commit is contained in:
oblomov 2023-07-24 14:00:27 +02:00 committed by GitHub
parent 4b09f36bb7
commit 21f91b1d27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 5 additions and 201 deletions

View File

@ -1,18 +0,0 @@
_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

@ -1,28 +0,0 @@
## How-to-PR
This tutorial explains how to transfer changes from a local ABAP system to the public abap2UI5 repository. <br>
**1. Create a Fork of the abap2UI5 repository on github:**
<img width="700" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/c044eb38-fff7-4d82-9142-839bcae63fa9"><br><br>
You now have a copy of the project in your own repositories:
<img width="700" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/081134d2-d54b-4179-ab20-6c8a51a91930">
<br><br>
**2. Link your local system with your new fork in abapGit:** <br>
Copy the url of your abap2UI5 repository:
<img width="700" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/c4973738-06e9-47e8-b23a-56f856125284"><br><br>
Link your system to this repository:<br>
(adt-abapgit or abapGit on-premise)<br>
<img width="400" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/466f5e1d-507d-4e99-8d49-81d2527e9281">
<img width="400" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/4c03d2be-a5c9-410e-a46a-14738da0f104">
<br><br>
**3. Push your changes to your fork**<br>
(adt-abapgit or abapGit on-premise)<br>
<img width="600" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/c1827f17-c46f-4ef1-ae8c-90f6ba232862"><br>
<img width="600" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/0227469b-9dc8-469c-80ac-4566171e0fc1">
<br><br>
**4. Create a Pull Request on github:**<br>
<img width="700" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/b0712305-06ac-4e99-9b7d-e5f4b52ab206"><br>
<img width="700" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/e1c5fd9d-062e-4b1d-843d-b7afb96d6d29">
<br><br>
**5. (optional) Try to correct the abaplint issues**<br>
<img width="700" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/1ab7d4fe-aab8-45c3-bf3c-caed4dec0365"><br>
<img width="700" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/7f603485-6854-4532-abdf-df3ba9ffbba2">

View File

@ -1,25 +0,0 @@
_Every help and PR extending abap2UI5 view class with additional properties is welcome!_
If you create a view and you miss a specific property or event of an UI5 control, you can extend the class z2ui5_cl_xml_view. It is an ABAP copy of the UI5 API. Just extend the importing parameters of the method with the additional property by doing the following:<br><br>
**(1) Check the UI5 API for the UI5 Control you want to extend:**
Go to the [UI5 API](https://sapui5.hana.ondemand.com/#/api) and search for your UI5 Control. (for example "Input") <br>
<img width="500" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/3c395aa6-c787-43fb-b40d-ae05df207ee6">
<br>
**(2) Check the properties and events of the UI5 Control:**<br>
Scroll down to see the properties:<br>
<img width="600" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/95d5be73-b2df-4a18-9c78-8ab52c32c4c6">
And events:<br>
<img width="600" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/8c37437f-36b7-4faf-a4d5-28c2b4662455"><br>
**(3) Find the property or event you newly want to add: (for instance "showclearicon")**<br>
<img width="1028" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/619da960-000e-4232-adc5-7722020fa53f"> <br>
**(4) Open the class z2ui5_cl_xml_view in eclipse and scroll to the method of the control:**<br>
<img width="300" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/de81b16b-e29b-46b7-bf94-95b92415c9d9"> <br>
**(5) Add the name of the new property in the method definition:**<br>
<img width="300" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/dae7f39d-d07e-455f-8ec4-e9aa4304956e">
(type is always "clike", optional, case is not relevant) <br>
**(6) Add the name of the new property in the method implementation:**<br>
<img width="300" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/811b7118-bfdc-4f1f-9a84-a164ee6dabec"><br>
(in this case it is a boolean, so wrap it into the helper method, normally no need for this) <br>
(7) Contribute your change by opening a PR.
**Thank you for your help!**

View File

@ -1 +0,0 @@

View File

@ -1,18 +0,0 @@
## Documentation
### Installation
* Install the project with abapGit (on-premise / cloud)
* Create a new HTTP service (on-premise / cloud)
* Configuration
### Development
* Create your first app
* Debugging
### Contribution
* Find a bug or miss a feature?
* Want to help out? <br>
* Create a Pull Request (on-premise / [cloud](https://github.com/abap2UI5/abap2UI5/blob/main/docs/contribution/how_to_pr.md))
### FAQ
[here](https://github.com/abap2UI5/abap2UI5/blob/main/docs/faq.md)

View File

@ -1,37 +0,0 @@
## Client & UI
#### **1. How to read URL parameters?**
Use the following snippet:
```abap
DATA(lv_search) = client->get( )-s_config-search.
DATA(lv_param) = z2ui5_cl_xml_view=>factory( client )->hlp_get_url_param( `myparam` ).
```
#### **2. How to format numbers, times and dates?**
Take a look to the following example: <br>
https://github.com/abap2UI5/demo-demos/blob/main/src/z2ui5_cl_app_demo_47.clas.abap
<img width="500" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/6b9011b5-94e6-4329-9666-0e779c01b400">
#### **3. How to format the output of currencies?**
Take a look to the following example: <br>
https://github.com/abap2UI5/demo-demos/blob/main/src/z2ui5_cl_app_demo_67.clas.abap
<img width="500" alt="image" src="https://github.com/abap2UI5/abap2UI5/assets/102328295/fef6e08c-5a34-4aee-9d34-ebb1c5d45275">
#### **4. How to call an url in a new tab?**
Use the following snippet:
```abap
client->timer_set(
interval_ms = 0
event_finished = client->_event_client( action = client->cs_event-open_new_tab t_arg = value #( ( `https://www.github.com/abap2UI5` ) )
) ).
```
## Productive Usage
#### **1. Can abap2UI5 used in a productive system?**
Yes, the project is technically just an implementation of an HTTP handler and can be used like any other HTTP Service in a productive scenario.
#### **2. Are there any dependencies or preparations needed before using abap2UI5 in a productiv scenario?**
No, but it is recommended to follow these steps before using abap2UI5 apps in a productive scenario:
1. Transport the abap2UI5 HTTP service and the framework first.
2. Sometimes an extra activation of the HTTP service is needed, along with an adjustment of the UI5 bootstrapping.
3. Test the "hello world" app to ensure that abap2UI5 works correctly.
#### **3. Does a stable version of abap2UI5 exist?**
The project will be continuously further developed. Therefore, there is no specific "stable" version. However, adjustments to the public APIs will be kept to a minimum to avoid frequent refactoring of apps. You can use [releases](https://github.com/abap2ui5/abap2ui5/releases/) instead of the main branch and only update from time to time when you want to reduce refactoring efforts.

View File

@ -1 +0,0 @@

View File

@ -1,28 +0,0 @@
CLASS zcl_my_handler_cloud DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_http_service_extension.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_my_handler_cloud IMPLEMENTATION.
METHOD if_http_service_extension~handle_request.
DATA(lv_resp) = SWITCH #( server->request->get_method( )
WHEN 'GET' THEN z2ui5_cl_http_handler=>http_get( )
WHEN 'POST' THEN z2ui5_cl_http_handler=>http_post( server->request->get_cdata( ) ) ).
server->response->set_header_field( name = `cache-control` value = `no-cache` ).
server->response->set_cdata( lv_resp ).
server->response->set_status( code = 200 reason = `success` ).
ENDMETHOD.
ENDCLASS.

View File

@ -1,26 +0,0 @@
CLASS zcl_my_handler_onprem DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_http_extension.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_my_handler_onprem IMPLEMENTATION.
METHOD if_http_extension~handle_request.
DATA(lv_resp) = SWITCH #( request->get_method( )
WHEN 'GET' THEN z2ui5_cl_http_handler=>http_get( )
WHEN 'POST' THEN z2ui5_cl_http_handler=>http_post( request->get_text( ) ) ).
response->set_status( 200 )->set_text( lv_resp
)->set_header_field( i_name = `cache-control` i_value = `no-cache` ).
ENDMETHOD.
ENDCLASS.

View File

@ -1,19 +0,0 @@
#### Repository
* abap2UI5 [(github/abap2UI5/abap2UI5)](https://github.com/abap2UI5/abap2UI5)
* downport of abap2UI5 for NW 7.02 to NW 7.42 [(github/abap2UI5/abap2UI5-downport)](https://github.com/abap2UI5/abap2UI5-downport)
#### Demos
* Examples of how to create apps in abap2UI5 [(github/abap2UI5/demo-demos)](https://github.com/abap2UI5/demo-demos)
* Open-source project Mustache used with abap2UI5 [(github/abap2UI5/demo-mustache)](https://github.com/abap2UI5/demo-mustache)
* SAP Developer Code Challenge using Axage with abap2UI5 [(scn/dev-challenge)](https://groups.community.sap.com/t5/application-development/sap-developer-challenge-open-source-abap-week-4/td-p/263470)
#### Extensions
* Integrate your apps to the on-premise fiori laúnchpad [(abap2UI5/integration_fiori_launchpad)](https://github.com/abap2UI5/ext-integration_fiori_launchpad)
#### Apps
* [abap2UI5-tools](https://github.com/abap2UI5/app-tools) [(abap2UI5)](https://github.com/abap2UI5/app-tools) <br> A useful collection of tools & apps
* [Axage](https://github.com/nomssi/axage/) [(nomssi)](https://github.com/nomssi) <br> A wizard's adventure game based on a fork of the [AXAGE game engine](https://github.com/Ennowulff/axage) (ABAP teXt Adventure Game Engine) by [ennowulff](https://github.com/Ennowulff)
<br><br>
_Your app not listed here? feel free to extend the list and send a PR_

View File

@ -239,6 +239,11 @@ CLASS Z2UI5_CL_HTTP_HANDLER IMPLEMENTATION.
` isUpdated = true;` && |\n| &&
` } } }` && |\n| &&
` if (isUpdated == false){` && |\n| &&
` if (sap.z2ui5.oViewNest == this.getView() ) {` && |\n| &&
` sap.z2ui5.oBody.oUpdate = sap.z2ui5.oViewNest.getModel().getData().oUpdate;` && |\n| &&
` isUpdated = true;` && |\n| &&
` } }` && |\n| &&
` if (isUpdated == false){` && |\n| &&
` sap.z2ui5.oBody.oUpdate = sap.z2ui5.oView.getModel().getData().oUpdate;` && |\n| &&
` }` && |\n| &&
` if (oEvent.CHECK_VIEW_DESTROY) {` && |\n| &&