You can do one thing . Can you pass this value to controller if you click on that link? if no then u need to store that value in a class variable.Like:
Public Class TestingClass { public Integer charLink{get;set;} public integer rowCount{get;set;} public TestingClass() { rowCount = 0; } public List<Account> getAccounts() { return [select id,name from Account limit 5]; } public void displayNumber() { } }
Hi Diya,
you need to define css in your VF page for this requirement.
like
<style>
.odd {
background-color:#FFFFFF;
}
.even {
background-color: #F8F8F8;
}
</style>
there is a attribute present in page block table called "row class".
Use the above css inside the row class attribute.
I think it will help you out.
Sagarika Rout
SFDC Developer
Hi,
You can do one thing . Can you pass this value to controller if you click on that link? if no then u need to store that value in a class variable.Like:
Public class AccountController {
public string char {get;set;}
}
suppose your page look like :
<apex:commandLink action="{!yourAction}" value="1" styleClass="{!IF(char == '1' ,'clickLink','links')}" >
<apex:param value="1" assignTo="{!char}" name="column"></apex:param>
</apex:commandLink>
And need to declare two CSS:
.links {
text-decoration:none;
}
.clickLink {
text-decoration:none;
background : #C6E1FF;
}
Please let me know if u have any problem on same and if this post help u please throw KUDOS by click on star at left.
it selected all 5 numbers
Hi Diya,
Could u please send me your code.
Public class AccountController {
public string char {get;set;}
rowcount - 0; - set in constructor
}
suppose your page look like :
<apex:variable value="{!rowCount}" var="ia"/>
<apex:column headerValue="Itemno" >
<apex:variable value="{!ia+1}" var="ia"/>
<apex:commandLink action="{!displaynumber}" value="ia" styleClass="{!IF(char == 'ia' ,'clickLink','links')}" >
<apex:param value="ia" assignTo="{!char}" name="column"></apex:param>
</apex:commandLink>
</apex:column>
And need to declare two CSS:
.links {
text-decoration:none;
}
.clickLink {
text-decoration:none;
background : #C6E1FF;
}
Hello Diya.
Please look in the below code for your reference:
Controller
Public Class TestingClass {
public Integer charLink{get;set;}
public integer rowCount{get;set;}
public TestingClass() {
rowCount = 0;
}
public List<Account> getAccounts() {
return [select id,name from Account limit 5];
}
public void displayNumber() {
}
}
Visual force page
<apex:page controller="TestingClass">
<apex:form>
<style>
.links {
text-decoration:none;
}
.clickLink {
text-decoration:none;
background : #C6E1FF;
}
</style>
<apex:pageBlock>
<apex:pageBlockTable value="{!Accounts}" var="acc">
<apex:variable value="{!rowCount}" var="ia"/>
<apex:column headerValue="Itemno">
<apex:variable value="{!ia+1}" var="ia"/>
<apex:commandLink action="{!displaynumber}" value="{!ia}"
styleClass="{!IF(charLink == ia,'clickLink','links')}" >
<apex:param value="{!ia}" assignTo="{!charLink}" name="column"></apex:param>
</apex:commandLink>
</apex:column>
</apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Please let me know if u have any problem on same and if this post helps u please throw KUDOS by click on star at left.