Monday, November 3, 2014

Headervalue not displayed in apex column tag

We have observed a strange behavior in headervalue property in <apex:column>tag. Header value won't display value if it is present within <apex:repeat> tags.

We were having a requirement where we need to display opportunity and its related competitor's record in one row. First Column will display opportunity fields and other columns will display field from different competitors related to opportunity. Number of columns will vary based on number of competitors. In order to display dynamic columns, we used <apex:column>  tags within <apex:repeat> tag. There are few fields which are common to opportunity and competitor object. User should be able to edit these fields for opportunity as well as for competitor in same page.

Below is sample code

Output:








In order to resolve this, we used Visualforce Dynamic Components. We created pageblocktable in apex and refereed it VF page.

Below is Code sample
Output after using Visualforce Dynamic Components:









Hope this might help you.

For more info on Visualforce Dynamic Components, Check below links:

https://www.salesforce.com/us/developer/docs/pages/Content/pages_dynamic_vf_components_intro.htm
https://developer.salesforce.com/page/Dynamic_Visualforce_Components

Looking forward for everyone's comment and suggestions.


3 comments:

  1. if you are working with a custom Visualforce page for a standard Salesforce object , make sure that there are no custom page or component overrides that might affect the rendering of column headers.If some one wants Professional Dissertation Writing Service at a cheap rate.You can easily make a call and feel free to contact with our team.

    ReplyDelete
  2. Thanks for sharing it will help me in my computer exams. but i am willing to pay someone to do my biology exam. interested one can contact me.

    ReplyDelete
  3. We had a requirement that required us to display an opportunity and any relevant competitor's performance in a single row. The first column will show the opportunity best muscle growth supplements fields, and the following columns will show the opportunity fields from various rivals.

    ReplyDelete