【问题标题】:Formatting Apex input field labels in a repeat重复格式化 Apex 输入字段标签
【发布时间】:2018-07-15 14:05:43
【问题描述】:

我在 SF 中设置了一个字段,我在 Visual Force 页面中使用该字段,并且字段标签的格式不完全配合。

这是我的代码。

<apex:pageblocksection columns="1" title="[...]" collapsible="false">
    <apex:repeat value="{!fields2}" var="c">
        <apex:inputfield value="{!ghostacc[c.fieldPath]}" required="true" style="white-space: nowrap; position: relative;"/> 
    </apex:repeat>      
</apex:pageblocksection>

结果是允许自动换行的输入字段的标签。有什么我想念的吗?

谢谢!

【问题讨论】:

    标签: salesforce visualforce apex


    【解决方案1】:

    &lt;apex:inputField&gt; 上的style 属性适用于输入本身,而不是它旁边的标签。

    尝试显式指定标签和输入,像这样?

    <apex:pageBlockSectionItem>
        <apex:outputLabel value="{!c.label}" style="nowrap magic goes here">
        <apex:inputfield value="{!ghostacc[c.fieldPath]}" required="true" />
    </apex:pageBlockSectionItem>
    

    【讨论】:

    • 抱歉,我花了一段时间才回复这个答案。我会试试这个,看看它有什么作用。
    猜你喜欢
    • 2010-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-01
    • 2011-10-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多