• sfdcElephant
  • 0 Points
  • Member since 2011

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
  • 3



 I have tried he following scenario,With the help of my friend Shrama(forceschool.blogspot.com),i blogged this example to help more to community friends,please follow the blog,




Thank u


Force.com Certified Developer


Hai friends,


   I am trying to add columns to data table dynamically,but i am not getting my requirement please help me for this scenario,


  Scenario:-  We need to display all required fields in datatable on page load,after that we need o take input from page,as how many number of columns should add,here if u entered 5 ,then 5 columns should add on button click to datatable,then after if u enetered 5 then from remaining list of fields 5 fields should added to datatable as columns.


Please help me


Thanks in Advance

sfdc Elephant

How to get a rendered value in dynamic list?

Hai friends,


       Can you any body help me to add Columns to Datatable on Vfpage Dynamically.I have to display all records in Data table on vfpage. we can add rows dynamically to datatable,but i need to add columns to datatable.Please help me in this scenario.


Thank u,


Based on the Dynamic Editing visualforce example, I am needing todisplay one of two fields depending on the picklist value. The field is "Create a New Account?" If the answer is yes, the Account Name text field will appear. If the answer is no, Account Name Lookup field will appear. Currently, here is my code for the specific section of the page:


apex:pageBlockSection title="Required Account Information" id="thePageBlock" columns="1">
            <apex:pageMessages />

            <apex:actionRegion >
                <apex:pageBlockSection columns="1">
                    <apex:pageBlockSectionItem >
                      <apex:outputLabel value="Create A New Account?"/>
                        <apex:outputPanel >
                            <apex:inputField value="{!Account.Create_A_New_Account__c}" required="true">
                                <apex:actionSupport event="onchange" rerender="thePageBlock"
                            <apex:actionStatus startText="applying value..." id="status"/>
            <apex:pageBlockSection columns="1"
                                   rendered="{!Account.Create_A_New_Account__c == 'Yes'}">
               <apex:inputField value="{!Account.Name}"/>

                <apex:inputField value="{!Opportunity.AccountID}"/>


Also, how do I customize the controller to create or retrieve the account?


Here is that code:


    public Account getAccount() {
        if(account == null) account = new Account();
        return account;