Skip to Content
0

Mouseover on table data(dynamic text control)

Apr 27 at 10:18 AM

17

avatar image

Hi All,

I have to show a popover when i do mouse over on a table data. I am trying with attachBrowserEvent but at the time of open the popover i am getting error like control is not yet rendered. I am using dynamic UI table.

oProp2 = new sap.m.Text({
text: "{"+oColumnObject.colValue+"}"
});oProp2.addStyleClass("vBoxItemsTop");
oProp2.attachBrowserEvent("mouseover", function(oEvent){
that.fnCommentDialog(oProp2);
 });
}); 

//that.fnCommentDialog(oProp2)

fnCommentDialog : function (oProp){
       if ( !this._oDialogComment) {
                 this._oDialogComment =  sap.ui.xmlfragment(this.getView().g                 etId(),"com.airbus.gmmtDelta2Harmo.fragment.CommentsDialo                   g", this);
                this.getView().addDependent(this._oDialogComment);
        }
        this._oDialogComment.openBy(oProp);
}

Please help me. Thanks in advance.

Regards,

Dinesh

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Sharath M G Apr 27 at 10:40 AM
0

Reason is your control is not fully rendered and you are attaching the event.

Try to attach the event after its creation. Move the attachbrowserevent code outside the control creation.

Use jQuery function to attach the event.

$(document).ready(function(){
    $("<Text control - ID>").mouseover(function(){
        fnCommentDialog(oProp2)
    });
});
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Sharath,

Thanks for your reply. I tried like you said but it's not working.

var oProp2 = new sap.m.Text("idNeuComm",{ text: "{"+oColumnObject.Colvalue+"}"
}); // in dynamic ui table
//i tried following code in onInit() and onAfterRendering()
$(document).ready(function(){ $("#idNeuComm").mouseover(function(){ this.fnCommentDialog("oProp2"); }); });

And i am not able to find out control with id.

0

Write the event assignment code in OnAfterRendering method.

0