Skip to content

[doc issue] No documented way to enable Application State Management in Flexible Programming Model (Custom Page Template) #205

@mmarkvillanueva

Description

@mmarkvillanueva

Issue description

We are developing an application using the Flexible Programming Model (FPM) with the Custom Page Template in SAP Business Application Studio.
The generated page uses the base controller sap/fe/core/PageController and XML Views containing sap.fe.macros.FilterBar and sap.fe.macros.Table.

However, we cannot find any documentation or working sample that shows how to activate Application State Handling (AppState) for such apps.
When filters are changed in the FilterBar, the URL does not update with the sap-iapp-state parameter, and the application does not restore its state on reload.

References

SAP official Flexible Programming Model sample:
https://ui5.sap.com/test-resources/sap/fe/core/fpmExplorer/index.html#/topic/customPage

Related Fiori Elements ViewState example (not applicable to Custom Page):
https://ui5.sap.com/test-resources/sap/fe/core/fpmExplorer/index.html#/controllerExtensions/viewState

API Reference: sap.fe.core.ExtensionAPI

Problem Summary

he available example (controllerExtensions/viewState) demonstrates state handling using sap/ui/core/mvc/ControllerExtension on an Object Page.
However, applications created using the Custom Page Template rely on sap/fe/core/PageController, not on a controller extension, and the same approach cannot be applied.

There is also no clear documentation on:

  1. How to register sap.fe.macros.FilterBar and sap.fe.macros.Table for application state management.

  2. Whether the framework automatically handles state persistence for these controls when using the Flexible Programming Model.

  3. Whether developers need to manually call updateAppState() via ExtensionAPI, and if so, how to register relevant controls so they participate in the AppState lifecycle.

Expected Behavior

When filters in the FilterBar are changed, the application should update the URL with a sap-iapp-state parameter.

On reload or navigation back, the filters and table state should be restored automatically.

The documentation should include an example or manifest configuration for enabling app state handling in the Flexible Programming Model (Custom Page).

Actual Behavior

Changing filters does not add sap-iapp-state to the URL.

The app state is lost when navigating back or reloading.

ExtensionAPI.updateAppState() is available but lacks guidance on how to register participating controls.

Steps to Reproduce

  1. Create a new app in BAS using the Custom Page Template (Flexible Programming Model).

  2. Add a FilterBar and Table via macros (sap.fe.macros.FilterBar and sap.fe.macros.Table).

  3. Run the app and change filters — observe that no sap-iapp-state is appended to the URL.

  4. Reload the app — the filter state is not restored.

Request

Please clarify or provide:

  1. Documentation or example for enabling Application State Handling in Custom Page (Flexible Programming Model) apps.

  2. Guidance on how to connect the FilterBar and Table to the AppState lifecycle via ExtensionAPI or manifest configuration.

  3. Confirmation whether this is a current limitation of the Flexible Programming Model.

Feedback Type (Optional)

None

Page Title on SAP Help Portal (prefilled)

No response

Page URL on SAP Help Portal (prefilled)

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions