Trying to compute which style sheet to load in a custom control and getting compositeData does not exist error.
Any ideas what the issue is?
this is being computed on the href element
if (compositeData.iconSet == "Full") {
"/CC_Style_full.css"
} else {
"/CC_Style_Condensed.css"
}
Is the calculation set to Compute Dynamically or Compute on Page Load? If it’s Compute Dynamically then it will not be computed until during the Render Response phase. In order for it to load the stylesheet, it may need to be added to the header, so may need to be available before the Render Response phase.
Try setting it to Compute on Page Load (${javascript:…}). That will mean the value is available much earlier in the lifecycle – it will be calculated during the Page Load event of XPages. Using Compute on Page Load is also be better for performance during partial refreshes. The only downside is that you will not be able to change the stylesheet dynamically.