I need to be able to conditionally change the color of output text based on the value of a fi\eld in a custom object. How do I code this in my VF page?
public with sharing class dynamicTextColor_Controller
{
private List<Opportunity> lstOpps; // we will color records in this based on amount
public dynamicTextColor_Controller()
{}
public List<Opportunity> getOpps()
{
lstOpps = [Select Name, Amount From Opportunity Where Amount != NULL Limit 20];
return lstOpps;
}
}
public with sharing class dynamicTextColor_Controller
{
private List<Opportunity> lstOpps; // we will color records in this based on amount
public dynamicTextColor_Controller()
{}
public List<Opportunity> getOpps()
{
lstOpps = [Select Name, Amount From Opportunity Where Amount != NULL Limit 20];
return lstOpps;
}
}
Hi,
Please refer below code, I had done something similar.
Visualforce code:
Apex Controller code :
Let me know if any questions!
All Answers
Hi,
Please refer below code, I had done something similar.
Visualforce code:
Apex Controller code :
Let me know if any questions!
Thanks for the help. Worked great.
thanks for the help....!!! it works..!!!