I’m trying to pimp a CUBA application and I have to admit I’m struggling with very basic tasks. So here is my next question:
I’m trying to highlight a tab on a certain condition and leave it blunt when condition is not met.
Here is what I have so far
<tabSheet id="allTabs" css="margin-bottom: 15px;">
<tab id="tabInfo" caption="Info" margin="true,false,true,false">
.....
</tab>
<tab id="tabLegalEntities" caption="Legal Entities">
........
In my screen controller I have the following:
private void setTabCaption(){
logger.info("setting tab caption");
if(getEditedEntity().getLegalEntities().size() > 0){
allTabs.getTab("tabLegalEntities").setIcon("font-icon:EXCLAMATION_CIRCLE");
allTabs.getTab("tabLegalEntities").setCaption("Legal Entities (" + getEditedEntity().getLegalEntities().size() + ")");
} else {
allTabs.getTab("tabLegalEntities").setIcon(null);
allTabs.getTab("tabLegalEntities").setCaption("Legal Entities");
}
}
// btw this doesn't refresh when I inject the tab itself:
// tabLegalEntities.setCaption("Legal Entities (" + getEditedEntity().getLegalEntities().size() + ")");
Which works and looks like this:
But I want a bit more, some additional styling like changing the font color or font weight or background even… Assigning styles doesn’t work as it seems…