gpt-3.5-turbo-0613· openai
Suzhen/CodeChat
How to passing parameter hiddenly in SAPUI5. I don't want the parameter to be shown in URL
- User
How to passing parameter hiddenly in SAPUI5. I don't want the parameter to be shown in URL
- Assistant
In SAPUI5, you can pass parameters hiddenly without showing them in the URL by using the "data" attribute of the control. Here's how you can do it:
- Define a control where you want to pass the parameter. For example, let's create a hidden input field within a form.
var oForm = new sap.ui.layout.form.SimpleForm({ content: [ new sap.ui.core.Title({ text: "Hidden Parameter" }), new sap.m.Input({ type: sap.m.InputType.Text, value: "your value", showValueHelp: false, visible: false, // Hide the field layoutData : new sap.ui.layout.form.GridElementData({ hCells: "3" }), layoutData : new sap.ui.layout.ResponsiveFlowLayoutData({ weight: 1 }) }) ] });- In your controller, retrieve the value of the hidden parameter when required.
var hiddenParameter = this.getView().byId("yourControlId").getValue();