widgetvar composite component VS naming container

444 Views Asked by At

I've make a composite component with an overlayPanel inside. I put my widgetVar like BalusC suggest: widgetVar="#{cc.id}_MyOverlayPanelWidget" and refer to with PF('#{cc.id}_MyOverlayPanelWidget').hide().

My need is to use my composite component into an p:tabview. It's valid to have same id for my component inside different naming container. The issue is when I load my 2 tabs, I have same widgetVar for 2 object. I won't use cc:clientId cause : isn't valid for widgetVar. What do you recommend for this situation?

1

There are 1 best solutions below

0
On

Use cc.clientId and replace all colons with a valid symbol. That's what PrimeFaces itself does when autogenerating widgetVars, it replaces colons with underscores.