【问题标题】:Using columns in a visual force page在视觉力量页面中使用列
【发布时间】:2016-01-26 19:16:32
【问题描述】:

我有一个收入明细的记录字段。我需要我的列看起来像他们在图片中所做的那样,这是我将显示的代码,除了我需要左列中的收入分类位于右列的底部。大约两天后,我对此很陌生,所以我可以使用我能得到的所有帮助当我尝试时,我得到错误,比如页面块项目下不能超过两个子元素。任何帮助都会很棒

<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>

【问题讨论】:

    标签: salesforce styling visualforce two-columns


    【解决方案1】:

    如果pageBlockSection 设置为两列(我相信默认设置),那么它会布置它的字段 Left->Right,然后向下一行,然后再次向 Left->Right。

    要推送一个字段,您可以添加一个空的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>
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-23
    • 2013-05-07
    • 1970-01-01
    相关资源
    最近更新 更多