Add sample 493 - classic FilterBar wired to variant management - #17
Merged
Conversation
cs_event-filter_bar_variant_init had no sample anywhere in the ecosystem, and it is the event that saves the most code: a classic sap.ui.comp.filterbar.FilterBar knows nothing about variants, so a list report normally hand-writes registerFetchData / registerApplyData / registerGetFiltersWithValues, an addPersonalizableControl( ) with a PersonalizableInfo, and a change handler per filter field. The action does all of it, so the app needs no JavaScript at all. 478 is the neighbouring case and shows why this one is separate: a SmartFilterBar knows its fields from OData metadata and registers itself, so it only needs smart_variant_init to place the anchor. Unlike the rest of the package this sample needs no service - a classic FilterBar builds from what the app names, and the three filter controls are ordinary two-way bound sap.m inputs over an ABAP table. That is also what makes the payoff visible: selecting a saved variant puts the values back into the fields AND, through the binding, into ABAP, so Go filters on the restored values without a roundtrip of its own. Registered in the package README, the overview app and the repository sample count. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LLqG5572QgSgbhfAWm7RAp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
A new Smart Controls sample for
cs_event-filter_bar_variant_init, which had no sample anywhere in the ecosystem.It is the event that saves the most code of any in the framework: a classic
sap.ui.comp.filterbar.FilterBarknows nothing about variants, so a list report normally hand-writesregisterFetchData/registerApplyData/registerGetFiltersWithValues, anaddPersonalizableControl( )with aPersonalizableInfo, and a change handler per filter field that marks the variant dirty. The action does all of it, so the app writes no JavaScript at all.478 is the neighbouring case and shows why this one is separate: a SmartFilterBar knows its fields from OData metadata and registers itself, so it only needs
smart_variant_initto place the anchor. Nothing in the package covered the classic bar — the closest was a classic FilterBar insamples-controlswith no variant management next to it.Unlike the rest of the package this sample needs no service: a classic FilterBar builds from what the app names, and the three filter controls are ordinary two-way bound
sap.minputs over an ABAP table. That is also what makes the payoff visible — selecting a saved variant puts the values back into the fields and, through the binding, into ABAP, so Go filters on the restored values without a roundtrip of its own.Registered in the package README, the overview app and the repository sample count (30 → 31).
How to test
Start
?app_start=z2ui5_cl_smpe_app_493, or pick it from the overview app.Monitors), press Go — the table filters and the toast reports the row count.Not runtime-verified. This package has no e2e suite, and variant persistence needs a system with
sap.ui.fl/ LREP, which the CI sandbox has neither of. Static checks are green; the behaviour above wants one manual pass on a real system before merge.Verified
npx abaplint(158 files),npm run check:abap2ui5(target OpenUI5 1.71),npm run check:overview— all clean.Companion to abap2UI5/abap2UI5#2561, the audit that found the gap.
Generated by Claude Code