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
Olivia FordeOlivia Forde 

What is this code doing

Hi All
I am trying to change the columns shown on a Page so I need to knwo how to refer to the fields the current ones are referenced like this
<th class="number">{!trnDiscount}</th>

So how do I add new fields



 
Best Answer chosen by Olivia Forde
Amit Chaudhary 8Amit Chaudhary 8

trnDiscount is nothing just a vaiable in Controller which is bind on VF page. To bind any variable on VF page we need to write like
{! Vaiable_Name}
So it is {!trnDiscount}
I hope this will help you

All Answers

Amit Chaudhary 8Amit Chaudhary 8
Hi Olivia Forde,

<Th> tag is used to create the table header and {!trnDiscount} will used to show the table header value.

Please check below link for more detail on table tag. I hope that will help you.
http://www.w3schools.com/tags/tag_th.asp

Please let us know if this will help you.

Thanks,
Amit Chaudhary
Olivia FordeOlivia Forde
Hi This is the bit I do not understand {!trnDiscount} – what does the !trn mean Regards Olivia [cid:image006.jpg@01CD902E.8CD33640] [cid:image002.png@01D06248.31CCFF30] [EOY Finalist 2013] [10258-seal]
Krishna SambarajuKrishna Sambaraju
If you want to display multiple records in a html table, here is an example.
<table>
	<tr>
		<th>Account Name</th>
		<th>Created Date</th>
	</tr>
	<apex:repeat value="{!accounts}" var="acct">
		<tr>
			<td>{!acct.Name}</td>
			<td>{!acct.CreatedDate}</td>
		</tr>
	</apex:repeat>
</table>

In the above code accounts is a public list variable, which gets the accounts using a soql query. As you can see Name and CreatedDate fields are added in the above example. You can add other fields similarly.

Hope this helps.
Amit Chaudhary 8Amit Chaudhary 8

trnDiscount is nothing just a vaiable in Controller which is bind on VF page. To bind any variable on VF page we need to write like
{! Vaiable_Name}
So it is {!trnDiscount}
I hope this will help you
This was selected as the best answer
Krishna SambarajuKrishna Sambaraju
Hi Olivia,
trnDiscount must be a public variable created in the controller the VF page is referencing.