You need to sign in to do that
Don't have an account?
Rustyboy
Apply same style class to all columns in a PageBlockTable
Hi,
I want to shade all columns in certain rows on a PageBlockTable based on the value of one of the fields in the table. Currently I have achieved this by adding the same StyleClass to each column (see below) which seems really clunky.
Is there a way to apply the StyleClass once for the entire row.
<apex:pageBlockTable value="{!attendees}" var="att" >
<apex:column headerValue="First Name" styleClass="{!att.Status__c}">
<apex:outputField value="{!att.First_Name__c}"/>
</apex:column>
<apex:column headerValue="Last Name" styleClass="{!att.Status__c}">
<apex:outputField value="{!att.Last_Name__c}"/>
</apex:column>
<apex:column headerValue="Known As Name" styleClass="{!att.Status__c}">
<apex:outputField value="{!att.Known_As__c}"/>
</apex:column>
<apex:column headerValue="Represents" styleClass="{!att.Status__c}">
<apex:outputField value="{!att.Represents__c}"/>
</apex:column>
<apex:column headerValue="Role" styleClass="{!att.Status__c}">
<apex:outputField value="{!att.Role__c}"/>
</apex:column>
<apex:column headerValue="Status" styleClass="{!att.Status__c}">
<apex:outputField value="{!att.Status__c}"/>
</apex:column>
</apex:pageBlockTable>
Thanks
I want to shade all columns in certain rows on a PageBlockTable based on the value of one of the fields in the table. Currently I have achieved this by adding the same StyleClass to each column (see below) which seems really clunky.
Is there a way to apply the StyleClass once for the entire row.
<apex:pageBlockTable value="{!attendees}" var="att" >
<apex:column headerValue="First Name" styleClass="{!att.Status__c}">
<apex:outputField value="{!att.First_Name__c}"/>
</apex:column>
<apex:column headerValue="Last Name" styleClass="{!att.Status__c}">
<apex:outputField value="{!att.Last_Name__c}"/>
</apex:column>
<apex:column headerValue="Known As Name" styleClass="{!att.Status__c}">
<apex:outputField value="{!att.Known_As__c}"/>
</apex:column>
<apex:column headerValue="Represents" styleClass="{!att.Status__c}">
<apex:outputField value="{!att.Represents__c}"/>
</apex:column>
<apex:column headerValue="Role" styleClass="{!att.Status__c}">
<apex:outputField value="{!att.Role__c}"/>
</apex:column>
<apex:column headerValue="Status" styleClass="{!att.Status__c}">
<apex:outputField value="{!att.Status__c}"/>
</apex:column>
</apex:pageBlockTable>
Thanks
I think you can apply styleclass for Pageblocktable itself.
Thanks.
<apex:pageBlockTable value="{!attendees}" var="att" >
<apex:column headerValue="First Name" styleClass="{!att.Status__c}">
<apex:outputField value="{!att.First_Name__c}"/>
</apex:column>
When I tried to move the StyleClass into the PageBockTable I received an error saying variable att.Status__c not known.
Is there a way I can wrap something around all the columns after the PageBlockTable? eg:
<apex:pageBlockTable value="{!attendees}" var="att" >
<apex:another Tag styleClass="{!att.Status__c}">
<apex column etc....
I thought of <apex:outputPanel> might work but didn't feel right
Thanks
Apologies, it may not have been clear in the original question. What I have DOES work, but it just seems a really inelegant way of solving the problem