Questions tagged [visualforce-component]

Visualforce components encapsulate a common design pattern and can be reused several times in one or more Visualforce pages. Salesforce provides a library of standard, pre-built components, such as <apex:relatedList> and <apex:dataTable>, that can be used to develop Visualforce pages. In addition, you can build your own custom components to augment this library.

Filter by
Sorted by
Tagged with
154
votes
3answers
25k views

End of javascript sidebar workarounds? (Salesforce Classic / Aloha)

Reading through this doc: Docs.releasenotes.salesforce We replaced the rich text editor in HTML Area home page components with a new version that supports more markup but doesn’t allow HTML to ...
14
votes
4answers
18k views

apex:inputFile can't be used in conjunction with an action component when deleting a row

When working on a visualforce page, I encountered this error: "apex:inputFile can not be used in conjunction with an action component, apex:commandButton or apex:commandLink that specifies a ...
6
votes
3answers
2k views

Dynamic components on a Visualforce page

I want to create a VF page inside which I will have component, where the user will have the flexibility to change the component without touching the code of the page. Dynamic, like this: <apex:...
12
votes
4answers
21k views

How do I pass a parameter from component to a Visualforce page?

Can I pass a email value from a visualforce component to a Visualforce page? I have used components for reusing Company's logo and few images... <apex:component> <apex:image value="{!$...
10
votes
3answers
1k views

Unable to rerender in visualforce Component

Getting trouble in Rerendering a form/output panel through VisualForce components. Visualforce component: <apex:component controller="Component_cls"> <apex:attribute name="first" type="...
14
votes
4answers
12k views

Setter method in VF component being called after the constructor has retured

VF page <apex:page> <c:MyCustomComponent someString="hello"/> </apex:page> MyCustomComponent (component) <apex:component controller="MyCustomComponentController"> <apex:...
16
votes
5answers
20k views

can we check if a key exists in a map in vf page

is it possible to check for a specific key in a map i.e., whether it exists or not in VISUALFORCE page? Based on this i need to render a pageblocktable.
8
votes
2answers
8k views

reports embedded in visualforce not showing

I have a few reports embedded in visualforce page using iFrame. Due to this new release of Spring '14, iFrame has stopped working and now these visualforce pages show blank screens. Can anyone help me ...
5
votes
2answers
13k views

Add Visualforce component to any page layout?

I created a Visualforce component that I'd like to add to a few page layouts, but it seems that the controller only allows for it to be on one object. Is there any way to create the component so that ...
15
votes
3answers
6k views

apex:include vs. Visualforce component, when and why?

I recently had a reason to look more closely at the standard apex:include component in Visualforce, and I'm intrigued by the intent behind this component. Would anyone be willing to share some ...
17
votes
4answers
6k views

render Blob image in PDF using Visualforce

Hi below is a snippet of a code where i am rerendering as pdf and have a blob image stored in a text field. When i display the blob image in VF page it displays fine, but when i display same image ...
13
votes
3answers
5k views

Reference inner class in Visualforce component

I'm trying to build a VF component that references an attribute that is an instance of an inner class. I followed the suggestion here on the Apex boards but it does not compile for me using V28.0. (...
2
votes
1answer
690 views

Order of execution for Visualforce page Get requests

I am new to VisualForce and trying to understand the order of execution and came across this example in the page developer's guide where a sample page uses a custom component- <apex:component ...
8
votes
1answer
6k views

Using a component to add attachments to visualforce email template and showing email link

We are trying to add attachments to an email template using a component. The code in the email template is: <messaging:emailTemplate subject="My Subject" recipientType="User" relatedToType="...
5
votes
2answers
12k views

how to pass value from visual force page (InputField) to controller?

I have created a Vf page from which i need to fetch the value of new owner and need to save the value in property defined in controller: Following is my vf page code: <apex:pageBlockSection> ...
3
votes
1answer
3k views

Can't call a component inside a page

I would like to create a VF page and call a custom component inside it. <apex:page controller="MyController"> <apex:form> <c:mycomponent id="myId" attributeName="{attributevalue}"/> </...
1
vote
1answer
511 views

DML When Component is Loaded

Preface: I understand that DML is not allowed in getters/setters or constructors. The normal workaround to performing DML on page load is to use the action attribute on the page; however, that's not ...
10
votes
2answers
3k views

How to call a standard controller action of a VF page from a VF component

I have a visual force page as follows which includes a component call Example one, Component has a command button and I want to call the standard controller save action of VF page from the VF ...
3
votes
3answers
10k views

Insert Attachment into Visualforce Email Template

this question: says that it is "hard" to put a component inside a visualforce email template because ' needs to be a child of component.'. Yet, is there a way to make this work? We also need to ...
16
votes
1answer
14k views

<apex:param> assignTo attribute not setting value to contoller variable

I am trying to assign value to a controller variable using assignTo attribute of apex:param component as shown below <apex:page controller="PageRefController"> <apex:form > <apeX:...
5
votes
1answer
10k views

how to pass values from Visualforce Email Template to custom component

I have created a simple visualforce email template: <messaging:emailTemplate subject="** Inventory Wishlist Match Found **" recipientType="User" relatedToType="Inventory_Wishlist__c"> <...
4
votes
1answer
5k views

Visualforce: Dynamically ReRender a row within <apex:repeat> by passing $Component through controller

I have a typical form with <apex:repeat> for some fields. The <apex:inputText> elements have an onChange attribute that references a script that then calls an <apex:actionFunction>, ...
6
votes
1answer
257 views

How to keep components out of the Visualforce view state when they are not needed?

The view state problem we mainly run into is not properties of the controller using it up (as we use transient heavily) but the component tree that the Visualforce tags generate using it up. That is ...
2
votes
2answers
698 views

how to overcome jquery conflict

I have a table which displays list of records.I want to achieve sorting and pagination function for this.As shown in figure i have achieved pagination and sorting.But this is affecting my tabs which ...
1
vote
1answer
10k views

Unable to get the selected pick list value in the controller

VF Page: <apex:page standardController="Order__c" extensions="MyOrderPadController" > <apex:detail /> <apex:form > <apex:pageBlock > <...
1
vote
1answer
4k views

How to replace or escape ' &amp; ' with ' & ' in Auto complete text in Jquery

I am using an autocomplete component in my VF page. And the Problem is when i am hovering / Selecting the record names with Special characters, the Input text box is displaying Encoded Record name as ...
3
votes
2answers
3k views

How to use StandardSetController in extension class

I want to create extension class with StandardSetController. public with sharing class AccountExtCtrl { private ApexPages.StandardSetController ctrl {get;set;} public AccountExtCtrl(ApexPages....
2
votes
3answers
6k views

passing data from Page controller to component Controller

I want to pass list of record from VF page controller to component controller but when i access variable in component controller using object creation then i am getting null value. I am taking Example ...
1
vote
2answers
1k views

Use standard stylesheet with custom for Chatter VF page

I am designing a custom styled vf page that will show the user's chatter feed. I am trying to use the chatter:feedWithFollowers component but all the styling goes away when I use the ...
1
vote
1answer
337 views

Visualforce Components: When your controller extends an abstract class, can you override the parent instance?

At the time I still have not received any feedback about my previous question so I went ahead with a different approach to my problem. Bare with me part of my problem might be because of how I changed ...
0
votes
0answers
98 views

how to mark checkbox true for particular record

I am facing problem in marking checkbox true. Below is my cases Case1:(It is correct and working) I need records which have duplicate names and do not have any opportunity or contact associated with ...
0
votes
1answer
785 views

how to create contact detail page using controller [closed]

public with sharing class ContactDetailController { private ApexPages.StandardController standardController; public string conId{get;set;} public ContactDetailController(ApexPages....
0
votes
1answer
66 views

How to access the name only from visual force component

I have Visual Force Component: <apex:component controller="myController1" access="global"> <p /> <apex:outputLink id="urlString" value="{!url}/{!$User.Id}</apex:outputLink> <...
-3
votes
1answer
36 views

Can we add a section in our vf page and add components to it [closed]

Can we add a section in our vf page and add components to it. I mean split my vf page into two parts and then add components to it.
18
votes
2answers
2k views

How to efficiently profile Visualforce components and their controllers?

I have a quite complex Visualforce component (edit grid) that is running to slow (2-4 seconds to display) When I say complex I mean: The Component itself is calling other components Many thousand ...
8
votes
2answers
14k views

Standard DateTime Picker in Visualforce

Does anyone know whether there is a standard Time picker or datetime picker available in Visualforce framework? Visualforce Date picker is a powerful component that can be easily used with . But when ...
8
votes
1answer
296 views

Unexpected Visualforce Order of Execution with component attributes on Get Request

I've hacked this small example of the unexpected order based on Order of Execution for Visualforce Page Get Requests. From the linked docs (my empahsis): The constructor methods on the ...
15
votes
4answers
5k views

Passing a map to a custom component

I need to pass a set of key/value pairs to a custom component. The specification of the key/values needs to be done in an apex:page definition, so something like this (IMPORTANT: The following code ...
8
votes
1answer
3k views

parameter not being passed in visualforce template

I've tried to schedule a recurring email but it seems the "salesRepID" parameter is not receiving the value from the "ToID" assignment because the proper records aren't being retrieved in the query at ...
7
votes
1answer
5k views

Does the assignTo attribute of apex:attribute not work for ApexPages.Action or PageReference types?

How would you pass a PageReference attribute to a custom component and have it assign to a variable on the component's controller? It seems like the assignTo attribute of apex:attribute does not work ...
2
votes
2answers
1k views

Sending pdf from static resources as attachment in visualforce email template

I am trying to add pdf from static resources to my Visual force email template attachment tag. VF email template which will be used by a workflow.I was able to render a image file from static resource ...
2
votes
3answers
1k views

Passing a list from VF component to VF page?

How would you pass an LIST from component to page I have wired-up everything I think but I'm sure I'm missing something that I'm unable to see the results returning on the VF Page. Here is the sample ...
8
votes
3answers
1k views

Dymamic components execution order issue

I have the following VF Component which uses a dynamicComponent tag inside of it. <apex:component controller="myController"> <apex:attribute name="identity" type="String" ...
5
votes
1answer
503 views

Visualforce Component Getter/Setters from a Base Class

Originally I wanted to attempt using the interface notation as an added layer of abstraction for this project for the time being I'm going with what I believed to be a simpler solution, unfortunately ...
4
votes
2answers
3k views

inputFile exceeds maximum viewstate limit

So I have a file uploader using inputFile component on my VF page. It works fine except when the page rerenders it now exceeds the maximum viewstate if a file is attached. This is a problem if the ...
4
votes
1answer
393 views

Calling APEX class from VisualForce component

I have written a APEX Class and when I copy the code and paste in Developer Console > Debug > Open Execute anonymous window, I get expected results. However, when I call the apex class from ...
3
votes
1answer
763 views

Is there a way to create a searchable picklist in a visualforce page?

I have a picklist field and I was wondering if there is a way to add a searchbox at the top of the picklist where we enter a picklist value and it searches through the picklist to find the values. ...
2
votes
2answers
1k views

How to solve the apex:attribute and assignTo naming conflict?

So consider a component with an attribute like this: <apex:attribute name="rentalContract" type="RentalContract__c" assignTo="{!rentalContract}"/> And this is how my controller looks like: ...
2
votes
1answer
3k views

How to call the controller to VF page with parameter

How to call the controller to VF page with parameter?I have two Visual force pages, and two controllers VF Page:DEMO <apex:page standardController="Account" extensions="NewAndExistingController" ...
2
votes
1answer
5k views

Display Radio buttons group in visualforce page

I have two objects Question__c and Answer__c. For every question record there will be 4 answer records. I need to have 4 answers as radio buttons for every question. How to display the answers as ...