Hello Experts,
I'm using images as a template for column
var oImgCopyReq = new sap.ui.commons.Image({ id : "copyReq", tooltip : bundle.getText("ROW_ACTION_COPY"), src :"/images/copy.png", decorative : false, visible : { parts: [ {path : "oReqListModel>BtnVisible"} ], formatter : function(btnVisible) { if (btnVisible==="f") { return false; } else { return true; } } } }) .addStyleClass("RowButtonsSpacer") .attachPress({"controller" : that}, that.onCopyReq);
Two additional images the same as 'oImgCopyReq'
oImgPrintReq...
oImgAttachmentsReq...
var oLayoutRowOperations = new sap.ui.layout.HorizontalLayout( oView.createId("Layout2"), {content: [oImgCopyReq, oImgPrintReq, oImgAttachmentsReq]} ); var oRowActionsCol = sap.ui.getCore().byId(this.createId('RowActionsCol')); oRowActionsCol.setTemplate(oLayoutRowOperations);
Because the visible property default value is true when I run the code I see the images for all rows and after a second or two it becomes visible false (because the formatter function is invoked).
How can I prevent this? changing default visible to false
Regards,
Omri