on 2022 Nov 03 2:28 PM
Hi Team,
I'm binded the data to F4 value help and I want to bind that Value Help data to my simple form. But I'm getting the error "setValue".
Could anyone give me the solution.
Regards,
Jakir
Error//
<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:l="sap.ui.layout" xmlns:f="sap.ui.layout.form" xmlns:core="sap.ui.core" controllerName="zthrift.zthriftt.controller.View1" displayBlock="true">
<Shell id="shell">
<App id="app">
<pages>
<Page id="page" title="{i18n>title}">
<content>
<VBox class="sapUiSmallMargin">
<f:SimpleForm id="SimpleForm" editable="true" layout="ResponsiveGridLayout" title="{i18n>formtitle}" labelSpanXL="3" labelSpanL="3" labelSpanM="3" labelSpanS="12" adjustLabelSpan="false" emptySpanXL="4" emptySpanL="4" emptySpanM="4" emptySpanS="0" columnsXL="1" columnsL="1" columnsM="1" singleContainerFullSize="false">
<f:content>
<Label text="Employee Number"/>
<Input id="input1" value="{Pernr}" showValueHelp="true" valueHelpRequest="onValueHelpRequest" />
<Label text="Employee Name"/>
<Input id="input2" value="{Vorna} {Nach2}"/>
<Label text="Employee Joining Date"/>
<Input id="input3" value="{Begda}"/>
<Label text="Employee End Date"/>
<Input id="input4" value="{Endda}"/>
<Label text="Duration of Service"/>
<DatePicker id="DP1" placeholder="Enter Date" change="handleChange" class="sapUiSmallMarginBottom" value="{Duration} {Zyear} {Zmonth} {Zday}"/>
<Label text="Employee Contribution since 2021 (SAR)"/>
<Input id="input5" value="{Value}"/>
<Label text="Thrift Plan Contribution Recovery (SAR)"/>
<Input id="input6" value="{Zcurr}"/>
</f:content>
</f:SimpleForm>
</VBox>
</content>
<footer>
<OverflowToolbar>
<ToolbarSpacer/>
<Button type="Accept" text="Calculate"/>
<Button type="Emphasized" text="Print"/>
</OverflowToolbar>
</footer>
</Page>
</pages>
</App>
</Shell>
</mvc:View>
// controller.js
sap.ui.define([
"sap/ui/core/mvc/Controller",
"sap/ui/core/Fragment",
"sap/ui/model/Filter",
"sap/ui/model/FilterOperator"
], function (Controller, Fragment, Filter, FilterOperator) {
"use strict";
return Controller.extend("zthrift.zthriftt.controller.View1", {
onInit: function () {
},
onValueHelpRequest: function (oEvent) {
if (!this._DialogEmployee) {
this._DialogEmployee = sap.ui.xmlfragment("zthrift.zthriftt.view.valueHelp", this);
this.getView().addDependent(this._DialogEmployee);
}
jQuery.sap.syncStyleClass("sapUiSizeCompact", this.getView(), this._DialogEmployee);
this._DialogEmployee.open();
},
_handleValueHelpConfirm: function (oEvent) {
debugger;
var oSelectedItem = oEvent.getParameter("selectedItem");
if (oSelectedItem) {
var productInput = this.byId(this._sInputId);
productInput.setValue(oSelectedItem.getTitle());
}
oEvent.getSource().getBinding("items").filter([]);
}
});
});
//fragment.xml
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">
<SelectDialog noDataText="No Records Found"
title="Select Table"
search="_handleValueHelpSearch"
confirm="_handleValueHelpConfirm"
cancel="_handleValueHelpClose"
items="{/EmployeeF4HelpSet}">
<StandardListItem title="{Pernr}"
description="{Rufnm} {Vorna} {Nach2}"
type="Active"/>
</SelectDialog>
</core:FragmentDefinition>
Hi Abdul,
looks like your this._sInputId is not set. I dont see it in code of your controller so maybe that is the problem. Otherwise the string in this._sInputId is bad and it cannot find the element with that Id.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this._sInputId did you initialize this variable?
why can't you just debug?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.