Skip to Content
Technical Articles
Author's profile photo Daniel Chang

How to focus on first ObjectPageSection (Subsection) when navigate from worklist in SAP UI5.

Hi All

I am a GRC application developer. I faced one development issue to always focus on the first ObjectPageSection (Subsection) when navigate from SAP UI5 list to details page. I would like to share my development experiences about the focus on first subsection when navigate from worklist in SAP UI5.

Issue :

How to focus on 1st subsection  again when navigate from worklist to detail sections and then click on second/third section to browse data and then back to worklist and navigate to details section again.

Answer:

<uxap:ObjectPageLayout id="ObjectPageLayoutEdit">
   <uxap:sections>
      <uxap:ObjectPageSection id="editAttrSection" showTitle="true" title="{i18n>detailIconTabBarInfoTab}" 
            titleUppercase="false" visible="true">
         <uxap:subSections>
            <uxap:ObjectPageSubSection id="editAttrSubSection"> </uxap:ObjectPageSubSection>
         </uxap:subSections>
      </uxap:ObjectPageSection>

     <uxap:ObjectPageSection id="editActSection" showTitle="true" title="{i18n>ActionsTab}" 
           titleUppercase="false" visible="true">
        <uxap:subSections>
          <uxap:ObjectPageSubSection id="editActSubSection"> </uxap:ObjectPageSubSection>
        </uxap:subSections>
     </uxap:ObjectPageSection>

     <uxap:ObjectPageSection id="editPrmSection" showTitle="true" title="{i18n>PrmsTab}" 
           titleUppercase="false" visible="true">
        <uxap:subSections>
            <uxap:ObjectPageSubSection id="editPrmSubSection"> </uxap:ObjectPageSubSection>
        </uxap:subSections>
     </uxap:ObjectPageSection>

   </uxap:sections>
</uxap:ObjectPageLayout>


You can use the following statements as samples to focus on 1st ObjectPageSection (subsection).

this.oObjectPageLayout = this.getView().byId(“ObjectPageLayoutEdit”);

this.oEditAttrSection = this.getView().byId(“editAttrSection”);

this.oObjectPageLayout.setSelectedSection(this.oEditAttrSection.getId());

 

Thanks and best regards,

Daniel

 

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Saurabh Singh
      Saurabh Singh

      Thank you for sharing.