I'm a little bit stuck getting a custom VisualForce component sized.
I've tried setting the width every way I can think of, but have seen no change. Here is the page code and component code.
I don't think the controllers are relevant.
The general idea is for the page to display the appropriate number of the component which allows the user to select from a number of drop downs and enter some input, and I would like each row of the pageBlock table to take up all available width.
<apex:page controller="xController">
<apex:form id="xForm">
<apex:pageBlock id="objSelectBlock" title="example title">
<apex:selectList value="{!objName}" required="true" size="1">
<apex:selectOptions value="{!objectSelect}"/>
<apex:actionSupport event="onchange" reRender="xBlock" action="{!changeFilterObject}"/>
</apex:selectList>
</apex:pageBlock>
<apex:pageBlock title="the {!objLabel} block..." id="xBlock">
<apex:repeat value="{!filter.criteria}" var="block" id="theRepeat">
<c:vfCriteriaBlock block="{!block}" id="theValue"/>
</apex:repeat>
</apex:pageBlock>
</apex:form>
And the component:
<apex:component selfclosing="true" html-width="100%">
<apex:attribute name="block" description="This is the block"
type="CriteriaBlock" required="true"/>
<apex:pageBlockSection id="blockInfo" html-width="100%">
<apex:pageBlockTable id="rulesTable" columns="4" value="{!block.criteria}" var="row" width="100%">
<apex:column width="10%"><img border="0" class="icon deleteIcon" src="{!$Resource.delete_icon}" alt="HTML tutorial" width="15" height="15"></img>
</apex:column>
<apex:column headerValue="Field" width="30%">
<apex:selectList value="{!row.xfield}" size="1">
<apex:selectOptions value="{!row.FieldList}"/>
<apex:actionSupport event="onchange" reRender="ops" />
</apex:selectList>
</apex:column>
<apex:column headerValue="Relation" width="30%">
<apex:selectList id="ops" value="{!row.operator}" size="1">
<apex:selectOptions value="{!row.OperandTypes}"/>
</apex:selectList>
</apex:column>
<apex:column headerValue="Filter Value" width="30%">
<apex:inputText value="{!row.filterValue}" />
</apex:column>
</apex:pageBlockTable>
</apex:pageBlockSection>
Here's what the xBlock looks like:
As you can see, it does not take up the full width.
Best Answer
You are wrapping the table in a
<apex:pageblocksection>
Either set
like this
or change the
<apex:pageblocksection>
to a<apex:pageblock>