由于标准的页面布局不允许您调整绑定到一个文本字段的inputfield的宽度,我试图创建一个VisualForce页,但没有为顶点的宽度属性:inputfield组件.我想我将不得不使用样式或CSS或其他东西,但我不知道如何.
我需要做些什么才能调整文本输入字段的宽度?
请使用Web界面(而非Force.com IDE)提供说明.谢谢.
编辑
我最终使用了这样的嵌入式样式
<apex:inputfield value="{!Country__c.Full_Name__c}" style="width:400px"/>
Run Code Online (Sandbox Code Playgroud) 随着12年春天的到来,旧的"黑客"转换丰富的编辑器将不再适用.在春季12之后可以做些什么来保留完整的CKEditor功能?
我有一个函数searchWorkByName,它以"key"作为参数,并使用SQOL来检索数据.
在visualforce方面,我有一个调用searchWorkByName的链接,但希望能够传递诸如字符'a'之类的参数
例如,(这会引发错误)
<apex:commandLink value="search!" action="{!searchWorkByName('aaa')}" />
Run Code Online (Sandbox Code Playgroud)
如果没有替代方案,是否可以这样做?
顶级课程
public class SearchWorkTest {
public PageReference searchWorkByName(String key) {
//find record of work names starting from provided key character
workNames = [select name from work__c where work__c.name like 'key%'];
return Page.searchResult;
}
}
Run Code Online (Sandbox Code Playgroud)
visualforce
<apex:page standardController="work__c" extenstions="SearchWorkTest">
<!-- Is it possible to pass argument like 'foo' ? -->
<apex:commandLink value="search!" action="{!searchWorkByName}" />
</apex:page>
Run Code Online (Sandbox Code Playgroud) 是否可以从我在visualforce中编辑的salesforce页面获取引荐来源?
我使用以下APEX方法
return ApexPages.currentPage().getUrl();
Run Code Online (Sandbox Code Playgroud)
...以上只返回当前网址和前一个网址或引荐网址
我要做的是创建一个自定义控制器列表,显示机会,案例和可能的另一个对象的混搭.我开始使用visualforce指南中的课程来帮助我:
public with sharing class CasePagination {
private final Case c;
public CasePagination(ApexPages.StandardSetController controller) {
this.c = (Case)controller.getRecord();
}
public ApexPages.StandardSetController CaseRecords{
get {
if(CaseRecords == null) {
return new ApexPages.StandardSetController(Database.getQueryLocator(
[SELECT c.CaseNumber, c.AccountId, c.Subject, c.Status FROM Case c]));
}
return CaseRecords;
}
private set;
}
public List<Case> getCasePagination() {
return (List<Case>) CaseRecords.getRecords();
}
}
Run Code Online (Sandbox Code Playgroud)
我调整了一些visualforce代码来显示现在的案例列表:
<apex:page standardController="Case" recordSetvar="cases" extensions="CasePagination">
<apex:pageBlock title="Viewing Cases">
<apex:form id="theForm">
<apex:pageBlockTable value="{!CasePagination}" var="c">
<apex:outputLink value="{!c.Id}">{!c.CaseNumber}</apex:outputLink>
<apex:column value="{!c.Id}"/>
<apex:column value="{!c.CaseNumber}" />
<apex:column value="{!c.Subject}" onclick="openCase"/>
<apex:column value="{!c.Status}" …Run Code Online (Sandbox Code Playgroud) 我是Visualforce的新手.
我在这里看这个页面:http://force.siddheshkabe.co.in/2010/11/displaying-aggregate-result-on.html
所以,当我将此代码添加到VisualForce页面时:
AggregateResult[] groupedResults = [SELECT Name, Days__c FROM Contact WHERE Days__c != ];
for (AggregateResult ar : groupedResults) {
System.debug('Name: ' + ar.get('Name') + '\nDays Taken : ' + ar.get('Days__c') + '\n');
Run Code Online (Sandbox Code Playgroud)
但它只是打印代码而不是执行它.我该怎么办?谢谢你的指导.
我想在我的沙盒中将我的visualforce页面作为主页.因此,可以将visualforce页面作为salesforce中的主页.
我有一个VF页面,它有2个日期字段和搜索按钮.
点击搜索我得到一些结果.我还有另一个按钮来打印这些结果,这只是一个新的VF页面呈现为pdf.
我想将此日期值传递到printVF页面.我也想把这个页面作为弹出窗口出现.
我有参数设置的pageref.由于我需要以弹出方式打开此页面,我需要找到一种方法来在window.open中使用pageref.
任何人都有关于如何实现这一目标的想法?
谢谢
Prady
编辑:我做的是在控制器中构建URL并在window.open中使用控制器变量.发生了一些非常奇怪的事情...第一次显示搜索结果并且我点击打印按钮,日期不会填充在字符串中,它们默认为今天的日期..如果我再次单击打印按钮日期正确填充在dateinput的url上.
public Class1(){
System.debug('inside constructor');
fieldContainer=new DummyTable__c(); // it contains date fields for date inputs
date todays=date.today();
If (fieldContainer.Start_Date__c== null)
{
startdate1=todays;
}else
{
startdate1=fieldContainer.Start_Date__c;
}
If (fieldContainer.End_Date__c== null)
{
enddate1=todays;
}
else
{
enddate1=fieldContainer.End_Date__c;
}
}
public void search()
{
startdate1=fieldContainer.Start_Date__c;
system.debug('startdate1'+startdate1);
enddate1=fieldContainer.End_Date__c;
system.debug('enddate1'+enddate1);
system.debug('inside search()....after clicking search button');
system.debug('startdate1'+startdate1);
system.debug('url'+url);
LoadData();
}
public string geturl()
{
url='apex/VF1?Pstartdate='+string.valueof(startdate1)+'&Penddate='+string.valueof(enddate1);
return url;
}
public string geturlRec()
{
urlRec='apex/VF2?Pstartdate='+string.valueof(startdate1)+'&Penddate='+string.valueof(enddate1);
return urlRec;
}
Run Code Online (Sandbox Code Playgroud)
VF
<script …Run Code Online (Sandbox Code Playgroud) <apex:outputLink value="/!{opportunity.id}">{!opportunity.Name}</apex:outputLink>
Run Code Online (Sandbox Code Playgroud)
我在VF中创建了2个页面.一页显示动态搜索中的自定义对象记录列表.这是完整的.
我现在需要创建一个自定义VF页面,以便在用户单击列表页面上的链接时显示单个记录信息.我知道我们可以使用如上所示的输出链接.
假设我已经构建了详细信息页面(假设其路径是"apex/customDetailPage"),我将如何修改此链接.因为我的详细信息页面需要传递给它的选定记录ID,我想.
我正在创建一个呈现为pdf(renderAs="pdf")的Visualforce页面,并且该页面不会呈现我的任何CSS样式.我正在包装我<style>,<head>如下所示.
<apex:page standardController="Account" readOnly="true" showHeader="false" sidebar="false" standardStylesheets="false" renderAs="pdf">
<head>
<style>
@page{
margin:1in;
}
.myTable {
border-collapse:collapse;
border:1px solid black;
}
</style>
</head>
<table class="myTable">
<tr>
<td>A Column</td>
</tr>
</table>
</apex:page>
Run Code Online (Sandbox Code Playgroud)
真正奇怪的是,我尝试复制另一个VF页面,我将其作为带有样式类等的PDF呈现,而IT也不会呈现.所以我想,"如果我将我的VF页面的API版本更改为27怎么办?" 而且,它有效.
有关修复此问题的任何想法都适用于API v28吗?或者这只是一个错误?