on 12-01-2015 7:30 AM
Hi All,
view :
<MultiInput showValueHelp="true" id="multiInput1" valueHelpRequest="handleValueHelp" width="180px"/>
init();
this.theTokenInput= this.getView().byId("multiInput1");
this.aKeys= ["AssetNumber", "AssetClass"];
this.aTokens= [];
this.theTokenInput.setTokens(this.aTokens);
handleValueHelp: function() {
this.aItems = [{
AssetNumber: "F-10001",
AssetClass: "F-10001",
CompanyCode: "0001 (SAP France)",
Description: ""
}, {
AssetNumber: "F-10001-1",
AssetClass: "F-10001-1",
CompanyCode: "0001 (SAP France)",
Description: "Construction"
}, {
AssetNumber: "X-0001.01.03",
AssetClass: "X-0001.01.03",
CompanyCode: "0001 (SAP France)",
Description: "Design"
}, {
AssetNumber: "X-0001.01.04",
AssetClass: "X-0001.01.04",
CompanyCode: "0001 (SAP France)",
Description: "Requirement"
}, {
AssetNumber: "X-0003.01.05",
AssetClass: "X-0003.01.05",
CompanyCode: "0001 (SAP France)",
Description: "WBSE for Simple Finance"
}];
var that = this;
var oValueHelpDialog = new sap.ui.comp.valuehelpdialog.ValueHelpDialog({
basicSearchText: this.theTokenInput.getValue(),
title: "Assets",
supportRanges: true,
supportRangesOnly: false,
supportMultiselect: true,
key: this.aKeys[0],
descriptionKey: this.aKeys[1],
ok: function(oControlEvent) {
that.aTokens = oControlEvent.getParameter("tokens");
that.theTokenInput.setTokens(that.aTokens);
oValueHelpDialog.close();
},
cancel: function(oControlEvent) {
sap.m.MessageToast.show("Cancel pressed!");
oValueHelpDialog.close();
},
afterClose: function() {
oValueHelpDialog.destroy();
}
});
var oColModel = new sap.ui.model.json.JSONModel();
oColModel.setData({
cols: [{
label: "Asset Number",
template: "AssetNumber"
}, {
label: "Asset Class",
template: "AssetClass"
}, {
label: "Company Code",
template: "CompanyCode"
}, {
label: "Description",
template: "Description"
}]
});
oValueHelpDialog.getTable().setModel(oColModel, "columns");
var oRowsModel = new sap.ui.model.json.JSONModel();
oRowsModel.setData(this.aItems);
oValueHelpDialog.getTable().setModel(oRowsModel);
oValueHelpDialog.getTable().bindRows("/");
oValueHelpDialog.setTokens(this.theTokenInput.getTokens());
var oFilterBar = new sap.ui.comp.filterbar.FilterBar({
advancedMode: true,
filterBarExpanded: false,
filterGroupItems: [new sap.ui.comp.filterbar.FilterGroupItem({
groupName: "gn1",
name: "n1",
label: "Asset Class",
control: new sap.m.Input()
}),
new sap.ui.comp.filterbar.FilterGroupItem({
groupName: "gn2",
name: "n2",
label: "Company Code",
control: new sap.m.Input()
}),
new sap.ui.comp.filterbar.FilterGroupItem({
groupName: "gn3",
name: "n3",
label: "Asset Number",
control: new sap.m.Input()
}),
new sap.ui.comp.filterbar.FilterGroupItem({
groupName: "gn4",
name: "n4",
label: "Description",
control: new sap.m.Input()
}),
new sap.ui.comp.filterbar.FilterGroupItem({
groupName: "gn5",
name: "n5",
label: "Cost Center",
control: new sap.m.Input()
})
],
search: function() {
sap.m.MessageToast.show("Search pressed '" + arguments[0].mParameters.selectionSet[0].getValue() + "''");
}
});
if (oFilterBar.setBasicSearch) {
oFilterBar.setBasicSearch(new sap.m.SearchField({
showSearchButton: false,
placeholder: "Search"
}));
}
oValueHelpDialog.setFilterBar(oFilterBar);
oValueHelpDialog.open();
oValueHelpDialog.update();
oValueHelpDialog.addStyleClass("sapUiSizeCozy");
}
I have this code.
will share screen shots:
I have a multiinput as
and a value help pops out :
As I check the check boxes and click on Ok.The values checked should come in multiInput.
Please guide me .
Tell me where my coding is getting wrong.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karan,
Increase your MultiInput control width. Then you can see the values, sample: Plunker (I used your code).
Regards,
Sai Vellanki.
Hi Sai,
I have panel which generates panels due to cutomList. In that panel I have that field of value help. The example you help me with cutomList. So due to list Id of the field is generating dynamically.So when I getting view by Id "MultiInput1". Its not getting the view.
Please help me getting dynamic Id
Thanks
Waiting fr ur Reply
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.