Skip to main content
corrected the question
Link
Sam
  • 4.4k
  • 2
  • 26
  • 41

Inconsistent rendering of Date and ID attributevalues in Visualforce page

Tweeted twitter.com/#!/StackSalesforce/status/350162811533524993
Source Link
Sam
  • 4.4k
  • 2
  • 26
  • 41

Inconsistent rendering of Date and ID attribute in Visualforce page

I am unable to understand why the inconsistency of the data that is displayed on the VF page. I am displaying Id and Date in the page block table. I am using the apex:column tag to display the data. When I declare the data in the value attribute without any space I get Id with 15 char in length but when I include a space in the value attirbute a 18 char Id is displayed. I am unable to understand why so?

enter image description here

apex:pageblock <apex:pageblockTable value="{!acc}" var="a"> <apex:column value="{!a.Id}" headerValue="Id without space(15 char)"/> <apex:column value=" {!a.Id}" headerValue="Id with space(18 char)"/> <apex:column value="{!a.CreatedDate}" headerValue="Date defined in the Value attributes"/> <apex:column headerValue="Date not declared in the Value Attribute" >{!a.CreatedDate}</apex:column> </apex:pageblockTable> </apex:pageblock>