我是visualforce的新手,我有几个问题。我能够创建一个基本的visualforce页面:
<apex:page standardController="Campaign">
<apex:sectionHeader title="Campaign" subtitle="Campaign Edit"/>
<apex:form id="theForm">
<apex:pageBlock title="Campaign" mode="edit">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!cancel}" value="Cancel"/>
<apex:commandButton value="Save & New" action="{!'save & new'}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="My Content Section" columns="2">
<apex:inputText value="{!Campaign.name}" id="name"/>
<apex:inputfield value="{!Campaign.Campaign_Type__c}">
<apex:actionSupport event="onchange" reRender="theForm" />
</apex:inputField>
<apex:inputtext value="{!Campaign.PPC__c}" rendered="{!Campaign.Campaign_Type__c == 'Campaign Type 1'}" />
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
“活动名称”字段是必填字段,如何在该字段旁边添加红色条?
如何将多个字段“组合”在一起,并将它们作为值插入到字段Campaign name中?例如,我有一个下拉字段"Campaign_Type__c=Type 1“,还有一个文本框字段"Campaign_textbox1__c=alex”,我想将它们组合为“Type1Alex”,并将其设置为字段名称"Campaign name“的值。
谢谢
发布于 2018-03-27 21:22:56
对于必需的,只需将属性设置为标记:
<apex:inputText value="{!yourVaue}" id="yourid" required="true" />发布于 2018-03-27 17:58:49
您可以不为活动名称创建公式字段吗?
将字段连接在一起的一种方法。因此,创建一个名为Campaign name的公式字段,然后使用下面的公式:
活动名称= Campaign_Type__c &“”& Campaign_textbox1__c
留出空格的原因是,否则它会像"Type 1Alex“一样粘合在一起。
对于您的另一个问题,我将使用HTML格式化来获得此结果。也许用烟斗?|--一根粗线条和红色的烟斗--但我很懒
发布于 2018-03-29 13:16:43
添加属性required="true"以使其成为必填项,即字段旁边的红色条。
因此,您可以通过以下方式实现这一点
<apex:inputText value="{!Campaign.name}" id="name" required="true"/>https://stackoverflow.com/questions/49500174
复制相似问题