You need to sign in to do that
Don't have an account?
Anindya Halder 6
Columns attribute of <apex:dataTable> is not working
Hello All,
I am very new to salesforce. I amtrying to display data in tabular format - in three columns
<apex:dataTable id="theTable" value="{!viewstate.GLAs}" var="glaState" styleClass="largerLabel" columns="{!viewstate.Columns}">
<apex:column>
<apex:inputCheckbox id="glaCheck" value="{!glaState.glaChecked}"/>
<label for="glaCheck" class="noSubLabel">{!glaState.GLAName}</label>
</apex:columnn>
</apex:dataTable>
In viewstate , getColumns will return 3 .
But all my data is being displayed in one single column.
Please help.
I am very new to salesforce. I amtrying to display data in tabular format - in three columns
<apex:dataTable id="theTable" value="{!viewstate.GLAs}" var="glaState" styleClass="largerLabel" columns="{!viewstate.Columns}">
<apex:column>
<apex:inputCheckbox id="glaCheck" value="{!glaState.glaChecked}"/>
<label for="glaCheck" class="noSubLabel">{!glaState.GLAName}</label>
</apex:columnn>
</apex:dataTable>
In viewstate , getColumns will return 3 .
But all my data is being displayed in one single column.
Please help.
All Answers
e.g.
Like
1000 1000 1000
2000 2000 2000
3000 3000 3000
4000 4000 4000
But I want to display in this format
1000 2000 3000
4000
Thanks for all your help . <apex:dataTable> does not work the way I was thinking . @Sura was right , if I want to display data in three separate columns I need to bind them separately .
I could not harcode the number of <apex:columns> or <tr><td> because its according to the size of the list my controller is returning.
I changed in the controller - instead of returning a list of objects(List of GLAs) , I made a list of lists - where each innerlists consists of three Objects(GLAs in this case) and then could use the code properly
<apex:dataTable id="theTable" value="{!viewstate.ListGLAs}" var="listGLA" styleClass="largerLabel" columns="3" width="100%">
<apex:repeat value="{!listGLA}" var="glaState">
<apex:column>
<apex:inputCheckbox id="glaCheck" value="{!glaState.glaChecked}"/>
<label for="glaCheck" class="noSubLabel">{!glaState.GLAName}</label>
</apex:column>
</apex:repeat>
</apex:dataTable>