Skip to Content

IconTabSeparator setVisible function from SAPUI5 doesn't work

Hi!

I'm developing an application utilizing the SAPUI5 framework and, as the documentation suggests, it should be possible for me to change the visibility of the Icon Tab Separator, since it indicates the "visible" parameter exists and the "setVisible" function also exists for this element (https://sapui5.hana.ondemand.com/#/api/sap.m.IconTabSeparator/methods/setVisible). But, when changing this parameter, nothing happens to the separator and when I attempt to use the "setVisible" function, it returns an error that claims such function doesn't exists. Is the documentation outdated or is there any specific way to use this function?

Thanks in advance,

Pedro Almeida

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Apr 19 at 05:51 PM

    Looks like this capability didn't exist until version 1.44. Alternatively you could just toggle a style using jquery

    $("#" + this.getView().byId("iconTabSeparator1").getId()).css('display', 'none');
    $("#" + this.getView().byId("iconTabSeparator1").getId()).css('display', '');

    Regards,

    Jamie

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 16 at 07:47 PM

    Here goes my code, thanks for the quick reply!

    Details.view.xml:

    ...

    <IconTabFilter id="details-iconTab-IconTabFilter-1" icon="sap-icon://hint" iconColor="Default" text="" count="" design="Vertical" showAll="false" textDirection="Inherit" enabled="true" visible="true" iconDensityAware="false" key="details"> ... </IconTabFilter> <IconTabSeparator id="iconTabSeparator1" icon="" iconDensityAware="false"/> <IconTabFilter id="risksTab" icon="sap-icon://message-warning" iconColor="Critical" text="" count="" design="Vertical" showAll="false" textDirection="Inherit" enabled="true" visible="true" iconDensityAware="false">... </IconTabFilter>

    ...

    Details.controller.js:
    ...

    this.getView().byId("iconTabSeparator1").setVisible(false);

    if (obj.woclass) { this.getView().byId("risksTab").setVisible(true); this.getView().byId("iconTabSeparator1").setVisible(true);
    } else if (prnum) { this.getView().byId("prlinesTab").setVisible(true); this.getView().byId("iconTabSeparator1").setVisible(true); }
    Add comment
    10|10000 characters needed characters exceeded

  • Apr 16 at 05:46 PM

    Just tried this and it worked without issue for me. Maybe your code is wrong or you are sending a string instead of a boolean. It would be helpful if you provided your code.

    Regards,

    Jamie

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 16 at 07:54 PM

    Have you tried setting it directly on the control

    <IconTabSeparator id="iconTabSeparator1" visible="false" icon="" iconDensityAware="false"/>

    What error do you see? What UI5 version?

    Regards,

    Jamie

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 17 at 05:33 PM

    Jamie,

    I've tried that as well, without success. My app is using UI5 version 1.38.31.

    Best regards,

    Pedro Almeida

    Add comment
    10|10000 characters needed characters exceeded