function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RustyboyRustyboy 

Adding fields to rows in UI which are not in the underlying object

I frequently have a requirement to list rows and a add field(s) to each row on the page which are not in the underlying table. I always end up adding "dummy" fields to the table so that I can use them in the UI. 

 

Is there a better, more elegant way of doing this?

 

Happy to provide examples if it helps

 

NB: I run up against the same problem when I want to render/disable a button or link for each row in a list based on the row's status etc.

 

Best Answer chosen by Admin (Salesforce Developers) 
levaleva

Try using decorator pattern. Check this video (from ~19min) it covers what you are looking for

 

https://www.youtube.com/watch?v=J372XmYds-A

 

 

All Answers

VaasuVaasu
Are you using Apex;Repeat in visual force pages?
levaleva

Try using decorator pattern. Check this video (from ~19min) it covers what you are looking for

 

https://www.youtube.com/watch?v=J372XmYds-A

 

 

This was selected as the best answer
RustyboyRustyboy

I generally use apex:pageBlockTable, but the requirement should be the same in either case (I think)

RustyboyRustyboy

The decorator pattern is exactly what I am after 

 

Thanks