I am trying to make the title of some tabs underlined if some specific content is shown on that tabs using ajax update (just titles, nothing else). Currently it works only if I
You cannot update individual tabs since they do not have renderers in PrimeFaces. What you can try is to move the title to a f:facet name="title"...
, put an h:outputText id="tabIdTitle"...
and update that outputText when required. This is supported since PF 3.2. So something like
<p:tabView id="m_tabview" widgetVar="m_tabviewWv" scrollable="false">
<p:tab title="Basic information">
<h:form id="base_form">
<!-- Some form data with submit button -->
</h:form>
</p:tab>
<p:tab id="documentsTab" name="documentsTab">
<f:facet name="title">
<h:outputText id="documentsTabTitle" value="#{clientform.documentsHeaderInline}" />
</f:facet>
<h:form id="documents_form">
<!-- Some form data with submit button -->
</h:form>
</p:tab>
<p:tab title="Social data">
<h:form id="social_data_form">
<!-- Some form data with submit button -->
</h:form>
</p:tab>
<p:tab id="contactsTab">
<f:facet name="title">
<h:outputText id="contactsTabTitle" value="#{clientform.contactsHeaderInline} "/>
</f:facet>
<h:form id="сontacts_form">
<!-- Some form data with submit button -->
</h:form>
</p:tab>
</p:tabView>
Thanks to Kukeltje and Geinmachi!
The right way is really to use a facet (but with CSS style separately because if you use CSS inline, the tags will be shown as is and text won't be underlined):
<p:tab id="documentsTab" name="documentsTab">
<f:facet name="title">
<h:outputText id="documentsTabTitle" value="Documents" style="#{clientform.documentsHeaderInline}"/>
</f:facet>
...
</p:tab>
and (in managed bean if necessary):
documentsHeaderInline = "text-decoration: underline;";