简体   繁体   中英

Are there Anchors in SAPUI5

I'm coding an e-recruiting platform in SAPUI5 at the moment and getting mad about a clean navigation.

At the moment the different data (personal data, experience, attachments,...) is displayed in its own panel that you can expand or not. I think it would be nice (especially mobile) if you can jump to the section you selected. I looked for some kind of anchors or something like that but after long search I couldn't find anything like that. Is there a chance to set anchors like in HTML to navigate to the right panel?

As of SAPUI5/OpenUI5 version 1.30 there is a sap.m.Wizard control which reflects your use case:

智者向导

If you want to test it you can try the latest OpenUI5 Snapshot version 1.29.x from the official download page .

Try this might work.

Assuming you have given Ids of Panels like following

for personal data Panel : "PersonalDataPanel"; for experience Panel : "ExperiencePanel"; for attachment Panel : "AttachmentPanel";

var oLink1 = new sap.ui.commons.Link({
    text: "Link to PersonalData", 
    href: "#PersonalDataPanel",
});
var oLink2 = new sap.ui.commons.Link({
    text: "Link to Experience", 
    href: "#ExperiencePanel",
});
var oLink3 = new sap.ui.commons.Link({
    text: "Link to Attachment", 
    href: "#AttachmentPanel",
});

OR

Replace links with raw "HTML" like :

var oLink1 =  sap.ui.core.HTML({
      content: "<a href='#PersonalDataPanel'>PersonalDataPanel</a>"
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM