on 09-25-2017 8:47 AM
Hi,
I have a table fetching oData and various input fields to apply filters.
On clicking F4 when the input field is active, a pop up with a list of filter values form oData service should appear. Now I wanted to use the same function for calling different dialogs, each through its respective input field using switch statement.Is this possible? If yes, how?
Thank You
As I understand, one function which handles value help for two fields.
Use the Event paramaters and attach some custom parameters to the event handler methods to differentiate the source of the call.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sharath,
I have tried that but am getting errors.The snippet I used is as following :
https://answers.sap.com/comments/316211/view.html
Its giving an error for passing inputID.
Thank You
When using a control by passing the input id, as a practice get the control into a separate variable and then perform the bind items or any further action on it.
Paste the code and line at which the error is raised.
Regards,
Sharath
Hi Aditi,
It is possible. Please explain more so that i can give u possible solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Irfan,
I have say 2 input fields each having multiple selection available.On pressing F4 when active, a pop up appears with respective filter values out of which more than one selection is possible, which on clicking on "Ok" would be applied to the table.Now to reduce redundant code, I wish to use the same function and call dialogs for the respective input field using the id of the input field.I tried the following code.But its giving the error : "Uncaught TypeError: Cannot read property 'open' of undefined"
_getDialog : function (inputId)
{
if (!this._valueHelpDialog)
{
switch (inputId)
{
case "MaterialID":
this._valueHelpDialog = sap.ui.xmlfragment("mpo.fragment.Dialog",this);
break;
case "MRPController":
this._valueHelpDialog = sap.ui.xmlfragment("mpo.fragment.DialogMRPCtlr",this);
break;
}
this.getView().addDependent(this._valueHelpDialog);
}
return this._valueHelpDialog;
},
handleValueHelp : function (oEvent)
{
var inputId = oEvent.getSource().getId();
this._getDialog(inputId).open();
},
_handleValueHelpSearch : function (evt) {
var sValue = evt.getParameter("value");
var oFilter1 = new sap.ui.model.Filter("MaterialID","EQ", sValue); evt.getSource().getBinding("items").filter([oFilter1]);
},
_handleValueHelpClose : function (evt) {
var oSelectedItem = evt.getParameter("selectedItem");
if (oSelectedItem) { var FilteredItems =oSelectedItem.getTitle();
var bindItems = this.byId("table").getBindingInfo("items"),
template = bindItems.template,
path = bindItems.path;
var filterMaterialID = new sap.ui.model.Filter("MaterialID", "EQ", FilteredItems);
}
this.getView().byId("table").bindItems(path, template, null, [filterMaterialID]);
},
onCloseDialog :function(){
this._getDialog().close();
}
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.