Skip to Content
0
Jul 02, 2018 at 08:37 PM

ValueHelprequest Event is not working

687 Views

I have a input field where i am trying to insert the "ValueHelp" and the event to appear from fragment xml and js file.

The project is just copied from a working one , i have everything assigned only the namespace is changed , but the event for value help is not working and i dont see errors in console.

Attached is the code:

in

1. View.xml

<VBox class="sapUiTinyMarginEnd" >
<Label text="{i18n>GTIN}" class="lab1" />
<Input id="masterGTIN" type="Text" placeholder="{parts:['i18n>Global Trade Item', '/#ObjItem/Gtin/@sap:label'], formatter: 'jQuery.sap.formatMessage'}"showValueHelp="true" valueHelpRequest="mdtradereport.delegate.MasterFilterDelegate.handleValueHelpRequest">
</Input> </VBox>

2. In delegate\MasterFilterDelegate.js

 handleValueHelpRequest: function (oEvent) {

        this._valueHelpSource = oEvent.getSource();

        if (this._valueHelpSource.getName() === "Gtin") {

          this._valueHelpDialog = this.getDelegate("Gtin");

          this._valueHelpDialog.open(this._valueHelpSource);

        } else {

          var sFragment = this._valueHelpSource.data("fragment") ? this._valueHelpSource.data("fragment") : this._valueHelpSource.getName();

          this._valueHelpDialog = sap.ui.xmlfragment(

            "mdtradereport.fragment.shared.valueHelp." + sFragment, this);

          this.getView().addDependent(this._valueHelpDialog);

          this._valueHelpDialog.addStyleClass("sapUiSizeCompact");

          this._valueHelpDialog.open();

        }

      },

Also not sure if ""mdtradereport.fragment.shared.valueHelp." in MasterFilterDelegate.js sholud be like that,(xmlfragment(

"mdtradereport.fragment.shared.valueHelp." + sFragment, this);

whereas the source where i copied which was working looks

===============================================

ar sFragment = this._valueHelpSource.data("fragment") ? this._valueHelpSource.data("fragment") : this._valueHelpSource.getName();
this._valueHelpDialog = sap.ui.xmlfragment(
"com.sap.cd.sttp.cockpit.fragment.shared.valueHelp." + sFragment, this);
this.getView().addDependent(this._valueHelpDialog);

==============================================


Can you get me some light on this what is wrong here ?

Attachments

valuehelp.jpg (188.7 kB)