我有一个记录领域,我是一个收入细分。我需要我的列看起来像它们在图片中所做的,这是我将要显示的代码,但我需要左列中的收入分类在右边列的底部。
当我尝试时,我会在页面块项下得到不能超过两个子元素的错误。

<apex:page standardController="EventPackageRevenueBreakdown__c"
extensions="EventPackageRevenueBreakdownExt" standardStylesheets="true"
tabstyle="EventPackageRevenueBreakdown__c">
<apex:form >
<apex:pageBlock mode="edit"
title="Event Package Revenue Breakdown Edit">
<apex:pageblockbuttons >
<apex:commandbutton action="{!save}" value="{!$Label.Package_Save}"></apex:commandbutton>
<apex:commandbutton action="{!SaveAndNew}"
value="{!$Label.Package_SaveAndNew}"></apex:commandbutton>
<apex:commandbutton action="{!cancel}"
value="{!$Label.Package_Cancel}"></apex:commandbutton>
</apex:pageblockbuttons>
<apex:pagemessages ></apex:pagemessages>
<apex:pageblocksection id="PackageEventInformationPBS"
title="{!$Label.Package_Information}">
<apex:pageBlockSectionItem >
<apex:outputpanel layout="block" styleClass="requiredInput"></apex:outputpanel>
</apex:pageBlockSectionItem>
<apex:outputpanel layout="block" styleClass="requiredBlock"></apex:outputpanel>
<apex:inputfield required="true"
value="{!EventPackageRevenueBreakdown__c.UnitPrice__c}"></apex:inputfield>
<apex:inputfield required="true"
value="{!EventPackageRevenueBreakdown__c.Location__c}"></apex:inputfield>
<apex:inputfield required="true"
value="{!EventPackageRevenueBreakdown__c.Name}"></apex:inputfield>
<apex:outputfield value="{!EventPackageRevenueBreakdown__c.BookingPackageEvent__c}" />
<apex:inputfield required="true"
value="{!EventPackageRevenueBreakdown__c.RevenueClassification__c}"></apex:inputfield>
</apex:pageblocksection>
<apex:pageblocksection title="Admin and Gratuity">
<apex:pageBlockSectionItem >
<apex:outputpanel layout="block" styleClass="requiredInput"></apex:outputpanel>
</apex:pageBlockSectionItem>
<apex:outputpanel layout="block" styleClass="requiredBlock"></apex:outputpanel>
<apex:inputfield required="false"
value="{!eventItem.AdminCharge__c}"></apex:inputfield>
<apex:inputfield required="false" value="{!eventItem.Gratuity__c}"></apex:inputfield>
</apex:pageblocksection>
</apex:pageBlock>
</apex:form>
</apex:page>发布于 2016-01-26 22:04:22
如果pageBlockSection被设置为两列(我相信是默认的),那么它将显示它的字段:左->右,然后向下一行,然后再左->右。
要将字段推倒,可以添加一个空的pageBlockSectionItem
您应该像这样布局您的字段:
<apex:pageblocksection id="PackageEventInformationPBS" title="{!$Label.Package_Information}" columns="2">
<apex:inputfield required="true" value="{!EventPackageRevenueBreakdown__c.UnitPrice__c}"/>
<apex:inputfield required="true" value="{!EventPackageRevenueBreakdown__c.Location__c}"/>
<apex:inputfield required="true" value="{!EventPackageRevenueBreakdown__c.Name}"/>
<apex:outputfield value="{!EventPackageRevenueBreakdown__c.BookingPackageEvent__c}"/>
</apex:pageBlockSectionItem> <!-- empty selectItem--> <apex:pageBlockSectionItem/>
<apex:inputfield required="true" value="{!EventPackageRevenueBreakdown__c.RevenueClassification__c}"/>
</apex:pageblocksection>https://stackoverflow.com/questions/35022004
复制相似问题