You need to sign in to do that
Don't have an account?
Visualforce: dataList + <table> tag producing bad HTML...bug??
I have a standard HTML table tag that has three columns in each column I am trying to render a apex:dataList by passing a list of data to it.
Here is my code:
<tr>
<td><strong>Capabilities 1:</strong>
<apex:dataList value="{!sk.sh1}" var="skh">
<apex:outputText value="{!skh.Characteristic__c}"/>
</apex:dataList>
</td>
<td><strong>Capabilities 2:</strong>
<apex:dataList value="{!sk.sh2}" var="skh">
<apex:outputText value="{!skh.Characteristic__c}"/>
</apex:dataList>
</td><td><strong>Capabilities 3:</strong>
<apex:dataList value="{!sk.sh3}" var="skh">
<apex:outputText value="{!skh.Characteristic__c}"/>
</apex:dataList>
</td>
</tr>
When the page renders it renders the table like this:
<tr>
<td><strong>Capabilities 1:</strong></td>
</tr>
<tr>
<td class="data2Col first " colSpan="2">
<ul class="" id="j_id0:j_id2:db:0:j_id3:j_id13:j_id15">
<li id="j_id0:j_id2:db:0:j_id3:j_id13:j_id15:0" class="">A/B ratio 1/8 or worse</li>
<li id="j_id0:j_id2:db:0:j_id3:j_id13:j_id15:1" class="">“Power Promoter” letters reflect no attemp</li>
</ul>
</td>
</tr>
<tr>
<td class="data2Col first " colSpan="2"></td>
<td><strong>Capabilities 2 :</strong></td>
</tr>
<tr>
<td class="data2Col first " colSpan="2">
<ul class="" id="j_id0:j_id2:db:0:j_id3:j_id13:j_id18">
<li id="j_id0:j_id2:db:0:j_id3:j_id13:j_id18:0" class="">“Power Promoter” letters reflect inconsistent attempt to create Action Plan</li>
</ul>
</td>
</tr>
<tr>
<td class="data2Col first " colSpan="2"></td>
<td><strong>Capabilities 3:</strong></td>
</tr>
<tr>
<td class="data2Col first " colSpan="2">
<ul class="" id="j_id0:j_id2:db:0:j_id3:j_id13:j_id21">
<li id="j_id0:j_id2:db:0:j_id3:j_id13:j_id21:0" class="">“Power Promoter” letters reflect consistent ability to create Action Plan</li></ul>
</td>
</tr>
<tr>
<td class="data2Col first last " colSpan="2"> </td>
</tr>
As you can see it is sticking in a bunch of extra <tr> & <td> tags. I even tried to render the List with apex:repeat and apx:datatable and still got the issue.
Any thoughts/ideas would be appreciated. Thanks!
I have the same issue.
I have 2 nested <apex:repeat>'s inside an <apex:pageBlockSection>, and I'm getting an extra <tr> rendered.
The extra tag is: <tr><td class="data2Col first " colspan="2"></td></tr>
I'll post a minimal test case tomorrow night when I have more time. If anyone has any ideas before then or would let me know that this is a known issue, I sure would appreciate it.
Thanks,
Rich C.
Arg i am getting the same problem. Ironically using a nested query works fine eg. below... Maybe this is a work around? Did anyone find a solution to this problem? the RefProd loop is bad but the rest is fine. :smileymad:
It's my belief that the problem are you having is using a data list and a table together. A Data List outputs 1 piece of data per row, for multiple rows. An HTML Table is built one row at a time, from left to right, top to bottom. So when you try to put a data list into the html table, it's going to create a new <tr> and <td> tag for each piece of data it puts out.
I'm not 100% sure on that, but it makes since according to how i've experienced their functionality. I'd suggest greating a seperate 1 column table for each data list and then just putting them side by side.