cancel
Showing results for 
Search instead for 
Did you mean: 

How do i implement showShare property in SAPUI5 Variant Management ?

Jayakrishnan
Active Participant
0 Kudos

Hi Everyone,

We are working on Custom SAPUI5 Application Development. In my requirement, i need to implement Variant Management functionality. I Implemented it by following the below blog.

Blog URL:

Variant management using shell services

Variant Management

I have not used SmartControls and Filter bar.

I did most of the part by following the above blog. But i am unable to make my variant user specific.

When i read the properties for variant-management control, it has showShare property(public and private). i enabled it in the view.

But i dont know how to implement it. I dont see any method is available to make it global or private in the shell personlaizarion service.

Screen 1:

When i create i chose as Public:

Screen 2:

Re-opening my app from FLP.

Code:

	saveVariant: function (sVariantName, bDefault, bGlobal, oFilterData, fnCallBack) {
			// save variants in personalization container
			this._oPersonalizationContainer.fail(function () {
				// call back function in case of fail
				fnCallBack(false);
			});
			this._oPersonalizationContainer.done(function (oPersonalizationContainer) {
				var oPersonalizationVariantSet = {},
					oVariant = {},
					sVariantKey = "";
				// check if the current variant set exists, If not, add the new variant set to the container
				if (!(oPersonalizationContainer.containsVariantSet("MyApplicationVariants"))) {
					oPersonalizationContainer.addVariantSet('MyApplicationVariants');
				}
				// get the variant set
				oPersonalizationVariantSet = oPersonalizationContainer.getVariantSet('MyApplicationVariants');


				//get if the variant exists or add new variant
				sVariantKey = oPersonalizationVariantSet.getVariantKeyByName(sVariantName);
				if (sVariantKey) {
					oVariant = oPersonalizationVariantSet.getVariant(sVariantKey);
				} else {
					oVariant = oPersonalizationVariantSet.addVariant(sVariantName);
					if (bDefault === true) {
						oPersonalizationVariantSet.setCurrentVariantKey(oVariant.getVariantKey());
					}
					// if (bGlobal === true) {
					// 	oVariant.setShowShare(true);
					// }
				}
				if (oFilterData) {
					oVariant.setItemValue("Filter", oFilterData);
				}
				oPersonalizationContainer.save().fail(function () {
					//call callback fn with false
					fnCallBack(false);
				}).done(function () {
					//call call back with true
					fnCallBack(true);
				}.bind(this));
			}.bind(this));
		},

How do i handle it?

Thank you,

Regards,

JK.

Accepted Solutions (1)

Accepted Solutions (1)

Jayakrishnan
Active Participant

As per the below information from SAP Note, we cannot implement showShare feature using the non-smart ui controls. is that right?

https://apps.support.sap.com/sap/support/knowledge/preview/en/2569161

Answers (0)