cancel
Showing results for 
Search instead for 
Did you mean: 

Value Help Dialog starts disabled ui5

0 Kudos
678

Experts,

I have a FIORI free style app. The main focus is, select fields from a Tree Table and then those fields will be used for filtering. This filters are being created as multi input and adding them the possibility of a value help dialog. Everything works except that I am getting the value help pop up, with the input field, disabled. I tried setting tokens to the value help, adding a model, instead of creating the value help thru code, using a fragment, nothing seems to work. Also tried debugging the standard, but I am not able to pin point the part that is actually creating the input field in the pop up.

Here is the code I am using.
Method beforeDisplay, is creating the new filter fields and the columns. Inside that method I am calling the method onOpenDialog which finally creates the valueHelpDialog.

PS: I've been fighting with this for the past 2 weeks, I already clicked on everything related to value help dialog in SAP forums, any help will be appreciate it

beforeDisplay: function () {
			var
				oForm = this.getView().byId("simpleFormSelection"),
				oTable = this.getView().byId("DynamicTable"),
				oSelectedTables = this.getOwnerComponent().getModel("SelectedTables").getData(),
				vIndCol = 0,
				vIndInp = 0,
				that = this;

			//we intialize the simple form and the columns data
			oForm.destroyContent();
			oTable.destroyColumns();
			this.myData = oSelectedTables;
			for (var index = 0; index < oSelectedTables.length; index++) {
				if (oSelectedTables[index].forSelection) {
					//we are in the selection fields, we create the title and the input field
					oForm.addContent(new sap.ui.core.Title({
						text: oSelectedTables[index].description
					}));

					var vInpSelId = "InpSelField" + vIndInp;
					oForm.addContent(new sap.m.MultiInput(vInpSelId, {
						// type: sap.m.InputType.Text,
						id: vInpSelId,
						showValueHelp: true,
						visible: true,
						enableMultiLineMode: true,
						editable: true,
						enabled: true,
						valueHelpOnly: false,
						// valueHelpRequest: [oController.onValueHelpRequest, oController]
						valueHelpRequest: function (evt) {

							var vId = evt.getParameters().id.replaceAll("InpSelField", "");
							that.onOpenDialog(evt, vId);
						}
					}));
					vIndInp++;
				}

				if (oSelectedTables[index].forDisplay) {
					//we are in the columns selected, we create a column per field selected
					var oColumn = new sap.m.Column("col" + vIndCol, {
						width: "1em",
						header: new sap.m.Label({
							text: oSelectedTables[index].description
						})
					});
					oTable.addColumn(oColumn);
					vIndCol++;
				}
			}

		},

		onOpenDialog: function (oEvent, vId) {
			var oLine = oEvent.getSource(),
				oView = this.getView(),
				that = this;

			// create popover
			// if (!that._pPopover) {
			// 	Fragment.load({
			// 		id: oView.getId(),
			// 		name: "ymeprocdynse16n.ymeprocdynse16n.fragments.Dialog",
			// 		controller: that
			// 	}).then(function (oPopover) {
			// 		that._pPopover = oPopover;
			// 		that.getView().addDependent(that._pPopover);
			// 		that._pPopover.open();
			// 	}.bind(that));
			// } else {
			// 	that._pPopover.open();
			// }
			// // jQuery.sap.require("sap.ui.comp.valuehelpdialog.ValueHelpDialog");
			var vInpSelId = "valueHelpDialog" + vId;
			var oValueHelpDialog = new sap.ui.comp.valuehelpdialog.ValueHelpDialog(vInpSelId {
				// basicSearchText: "test",
				title: 'Countries',
				supportRanges: true,
				supportRangesOnly: true,
				supportMultiselect: true,
				visible: true,
				// blocked: false,
				// maxConditions: 1,
				// key: vInpSelId,
				// descriptionKey: vInpSelId,
				// supportRanges: true,
				// supportRangesOnly: true,
				filterMode: true,
				// displayFormat: "UpperCase",
				// maxIncludeRanges: 1,
				// maxExcludeRanges: 0,
				// maxConditions: 1,
				// key: 'MyKey',
				// descriptionKey: 'my description',

				ok: function (oControlEvent) {
					oValueHelpDialog.close();
				},

				cancel: function (oControlEvent) {
					oValueHelpDialog.close();
				},

				afterClose: function () {
					oValueHelpDialog.destroy();
				},
			});
			// oValueHelpDialog.setModel(myService.createJSONModel(this.myData));
			// oValueHelpDialog.removeStyleClass("sapMInputBaseDisabled");
			// var oEvent.oSource.getParent().setEditable(true);
			oValueHelpDialog.open();

}

yilmazozkn
Participant
0 Kudos

Hi, you need to set RangeKeyFields,like:
oValueHelpDialog.setRangeKeyFields([{ label: "Product", key: "Product" }]);

yilmazozkn
Participant
0 Kudos

Hi, you need to set RangeKeyFields,like:
oValueHelpDialog.setRangeKeyFields([{ label: "Product", key: "Product" }]);

Accepted Solutions (0)

Answers (0)