cancel
Showing results for 
Search instead for 
Did you mean: 

Enable or Disable Fragments by ID in SAP BAS

tamilselvanm
Participant
0 Kudos

Hi Team,

There are two fragements in the page. Based on the button action, I have to enable only one fragment at the time.

How can we achieve it?

<Page id="page" title="{i18n>title}">

<core:Fragment id="idCallFrag" fragmentName="ztestfr.fragment.Dialog" type="XML"/>

<core:Fragment id="idCallFrag2" fragmentName="ztestfr.fragment.Dialog2" type="XML"/>

</Page>

Regards,

Tamilselvan

View Entire Topic
ssrinivas
Advisor
Advisor
0 Kudos

Hello tamilselvanm,

As mentioned by Saad. Use visibility option to toggle between the fragments

<Page id="page" title="{i18n>title}">
<core:Fragment visible="{/ActionA}" id="idCallFrag" fragmentName="ztestfr.fragment.Dialog" type="XML"/>
<core:Fragment visible="{= !${/ActionA}} "id="idCallFrag2" fragmentName="ztestfr.fragment.Dialog2" type="XML"/>
</Page>
tamilselvanm
Participant
0 Kudos

Hi Srinivas,

Currently I have the code like below and need to call Fragments based on Segmented button actions.

Regards,

Tamilselvan

ssrinivas
Advisor
Advisor

Hello tamilselvanm

https://plnkr.co/edit/8DIO4dEgjeYCi0yj
PS : Mark as solution provided if the case is solved. So we can close it. Thank you

Srinivas

tamilselvanm
Participant
0 Kudos

Thanks Srinivas,

Your example helped me to solve the issue.

Thanks,

Tamilselvan