You need to sign in to do that
Don't have an account?
Jim Montgomery
PageBlock Table row conditional styling based on page parameter value
I am trying to have the selected row highlighted when the select button is clicked.
Since there is no action associated with the select command link, the page refreshes after clicking select, thus erasing any styling not based on the parameter ConId.
I am trying to have the styling applied conditionally based on the page parameter ConId.
<apex:page standardController="Account"> <apex:form > <apex:pageblock > <apex:pageblocktable value="{!account.Contacts}" var="item"> <apex:column headerValue="Select"> <apex:commandLink > <Apex:Outputtext value="Select"/> <apex:Param name="ConId" value="{!item.id}"/> </apex:CommandLink> </apex:column> <apex:column value="{!item.name}" style="{!if(item.id='{!$CurrentPage.parameters.ConId}','color:red','color:black')}"/> <apex:Column value="{!item.title}"/> <apex:Column value="{!item.Phone}"/> <apex:Column value="{!item.email}"/> <apex:Column value="{!item.mobilephone}"/> <apex:Column value="{!item.Inactive__c}"/> <apex:Column value="{!item.id}"/> </apex:pageblockTable> </apex:Pageblock> <br/> <br/> <apex:OutputLink value="{!account.ContactCallURL1__c}{!$CurrentPage.parameters.ConId}{!account.ContactCallURL2__c}"> <apex:OutputText style="color:blue;" value="Next"/> </apex:OutputLink> strId = {!$CurrentPage.parameters.ConId} </apex:form> </apex:page>
Since there is no action associated with the select command link, the page refreshes after clicking select, thus erasing any styling not based on the parameter ConId.
I am trying to have the styling applied conditionally based on the page parameter ConId.
<apex:page standardController="Account"> <apex:form > <apex:pageblock > <apex:pageblocktable value="{!account.Contacts}" var="item"> <apex:column headerValue="Select"> <apex:commandLink > <Apex:Outputtext value="Select"/> <apex:Param name="ConId" value="{!item.id}"/> </apex:CommandLink> </apex:column> <apex:column value="{!item.name}" style="{!if(item.id='{!$CurrentPage.parameters.ConId}','color:red','color:black')}"/> <apex:Column value="{!item.title}"/> <apex:Column value="{!item.Phone}"/> <apex:Column value="{!item.email}"/> <apex:Column value="{!item.mobilephone}"/> <apex:Column value="{!item.Inactive__c}"/> <apex:Column value="{!item.id}"/> </apex:pageblockTable> </apex:Pageblock> <br/> <br/> <apex:OutputLink value="{!account.ContactCallURL1__c}{!$CurrentPage.parameters.ConId}{!account.ContactCallURL2__c}"> <apex:OutputText style="color:blue;" value="Next"/> </apex:OutputLink> strId = {!$CurrentPage.parameters.ConId} </apex:form> </apex:page>
Try this once....
All Answers
Please try adding rerender="SOMEDUMMYNAME" on commandlink and check once.
Try above code
Try this once....