Step 38: Accessibility

介绍

As the last step in this tutorial, we are going to improve the accessibility of our app.

1.练习效果

Step 38: Accessibility - 第1张  | 优通SAP

2.源码

You can view and download all files at Walkthrough – Step 38.

One part of the ARIA attribute set is the so-called landmarks. You can compare landmarks to maps in that they help the user navigate
through an app. For this step, we will use Google Chrome with a free landmark navigation extensionStep 38: Accessibility - 第2张  | 优通SAP We will now add meaningful landmarks to our code.

3.webapp/view/Overview.view.xml

We use sap.m.PageAccessibleLandmarkInfo to define ARIA roles and labels for the overview page areas. For more information, see the API Reference:
sap.m.PageAccessibleLandmarkInfo
.

4.webapp/view/InvoiceList.view.xml

We
add a sap.m.Panel around the invoice list, and we move the toolbar from the table into the panel so the region can take
the title of the toolbar as its own. This has the effect that it will now be a region in our landmarks.

5.webapp/view/HelloPanel.view.xml

In
this view, we already have a panel, so we just add the accessibleRole attribute.

6.Note

To add ARIA roles, labels and panels to other views, for example your Detail.view.xml, you can follow the same pattern. We won’t go into detail in this tutorial step, but if you’re interested, simply download the tutorial code and take a look at the Detail.view.xml.

7.webapp/i18n/i18n.properties

Here,
we add the text for the rating panel title and the labels for the ARIA regions to the text bundle.

8.Result

Step 38: Accessibility - 第3张  | 优通SAP Step 38: Accessibility - 第4张  | 优通SAP
Landmarks on the overview page – before Landmarks on the overview page – after
As you can see, we now have four landmarks on our page. The top three landmarks structure our page:

 

  • Overview Page marks the complete page.

     

  • Header marks the page title.

     

  • Page Content marks the content of our page. This landmark already has two children.

     

9.Congratulations!

You’ve completed the walkthrough, good job! You should be familiar with all
major development paradigms of SAPUI5 now. Our other tutorials focus on
certain aspects of SAPUI5, so feel free to explore!

留下一个回复

你的email不会被公开。