Skip to Content
0
Jan 23, 2022 at 11:56 AM

Not getting data in Popover

298 Views Last edit Jan 24, 2022 at 10:21 AM 2 rev

I have a button in a table row. when I click that button popover opens, but the data is not shown.

labelprefix.png

this is what my code looks like for popover.

_handleLABEL: function(oEvent) {
    //1 open a popover and show labels
    var oCtx = oEvent.getSource().getBindingContext("poItem101SetJson");
    let oControl = oEvent.getSource();
    let oView = this.getView();

    // create popover
    if (!this._pPopover) {
        this._pPopover = Fragment.load({
            id: oView.getId(),
            name: "com.wel.goodsreceipt.fragments.popover.LabelPopOver",
            controller: this
        }).then(function(oPopover) {
            oView.addDependent(oPopover);
            oPopover.bindElement({
                path: oCtx.getPath(),
                model: "poItem101SetJson"
            });
            // oPopover.bindElement(oCtx.getPath(), { model: "poItem101SetJson"});
            oPopover.attachAfterOpen(function() {
                this.disablePointerEvents();
            }, this);

            oPopover.attachAfterClose(function() {
                this.enablePointerEvents();
            }, this);
            return oPopover;
        }.bind(this));
    }
    this._pPopover.then(function(oPopover) {
        oPopover.openBy(oControl);
    });
},<br>

XML

<List id="id_list_inside_popover">
   <InputListItem id="id_inputlistItem_popover" label="Label Prefix">
      <Input class="input_css" liveChange="onLiveChangeForLabelPopOver" width="70%" id="id_label_prefix_input_field" value="{ShortText}" />
   </InputListItem>
   <InputListItem id="id_inputlistItem_popover_1" label="Counter Start">
      <Input class="input_css" liveChange="onLiveChangeForLabelPopOver" width="72%" value="{poItem101SetJson>ShortText}" id="id_counter_start_input_field" />
   </InputListItem>
   <InputListItem id="id_inputlistItem_popover_2" label="Label Start">
      <Text id="id_label_start_text_field" text="{poItem101SetJson>ShortText}" />
   </InputListItem>
   <InputListItem id="id_inputlistItem_popover_3" label="Label End">
      <Text id="id_label_end_text_field" text="{poItem101SetJson>ItemType}" />
   </InputListItem>
</List><br>

Attachments

labelprefix.png (28.4 kB)