You need to sign in to do that
Don't have an account?
SFDC_Learner
Bold text from apex class
Hi I have a list of records that i am displaying in visual force page like below
code Name
A001 Test1
A002 Test2
A003 Test3
Is there any possibility to make a text as bold from the apex class. Suppose for "A002", can i show this value in bold text??
it should be done in VF page. Simply add the text you want in bold
inside:
<b> BOLD TEXT</b>
If you know ahead which values will be bold(meaning no custom logic in apex), then it would be best to use style="font-weight:bold;" and hardcode this style into your visualforce.
But if you require custom logic within apex to determine if it will be bold or not
There is a way to do it through Apex with a Wrapper Class, but it is not really recommended.
Basically you would wrap the data as so.
String aTest, Boolean bBoolean
1) Test1, false
2) Test2, true (for bold)
3) Test3, false
Then in the Visualforce page you would render the style based on if it was true or false. (you would use an if/else in visualforce)
I have done this before, but I honestly wouldnt recommended unless it is absolutely necessary.