+ Start a Discussion
prageethprageeth 

Can't wrap text in a DIV tag which is located inside a Facet

Hello;

  I have a problem that I can't atleast guess the reason. I have following VF page

<apex:page renderAs="pdf" standardController="opportunity">

    <apex:datatable value="{!opportunity}" var="v" style="width:100%;border:solid green 1px;">

        <apex:column width="25%" style="border:solid green 1px;">

            <apex:facet name="header">

                <DIV style="border:solid red 1px;width:100%;">

                    This text should be wrapped because it is too long. 

                </DIV>

            </apex:facet>

        </apex:column>


        <apex:column width="75%" style="border:solid green 1px;">

            <apex:facet name="header">

                <DIV style="border:solid red 1px;width:100%;">

                    This is second column. 

                </DIV>

            </apex:facet>

        </apex:column>

    </apex:datatable>


    <apex:datatable value="{!opportunity}" var="v2" style="width:100%;border:solid green 1px;">

        <apex:column value="{!opportunity.name}"/>

    </apex:datatable>

</apex:page>

 

My problem is the first DIV in first table doesn't  wrap the text inside it. Instead it lets the text to expand outside the DIV.

But if I removes the value="{!opportunity.name}" part in second table it wraps the text and works nicely.

If I changed the value as  value="{!opportunity.id}" or as any other thing, the error occures.

Or if I put a value attribute in the first table the same error occures.

Can anybody explain me what the problem is. I'm ready to supply more info at any time. Thanks.

jwetzlerjwetzler
use

<apex:outputPanel layout="block">

 which will generate a div tag for you (or you can leave off the layout attribute and it will make a span tag for you)

Message Edited by jwetzler on 10-06-2009 07:07 AM
prageethprageeth
I tried using "<apex:outputPanel>" instead of "<DIV>". But it didn't solved my problem.