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
155
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
19k 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:...
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="...
16
votes
5answers
21k 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
9k 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 ...
17
votes
4answers
7k 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 ...
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 ...
14
votes
4answers
13k 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:...
12
votes
4answers
23k 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="{!$...
16
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 ...
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. (...
9
votes
1answer
7k 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="...
2
votes
1answer
708 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 ...
5
votes
2answers
13k 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> ...
4
votes
1answer
258 views

Unmanaged component in Managed Email template

I'm having some trouble editing the content of a Managed Email Template, I can quite easily modify the content of the Email Template, but when I wish to refer to an unmanaged component, like this: &...
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
727 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 ...
8
votes
2answers
15k 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 ...
3
votes
3answers
11k 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:...
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 ...
6
votes
1answer
11k 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
380 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
735 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
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 ...
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 > <...
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
1answer
1k views

How to add multiple attachments to an email template?

I'm creating a UI that feeds into an email template via visualforce. One of the features I want to add is the user should be able to click checkboxes and add attachments to an email template. When ...
1
vote
1answer
346 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 ...
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 ...
0
votes
1answer
75 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> <...
0
votes
1answer
500 views

Is it possible to communicate with other VisualForce pages/components from a VF component?

I have a VisualForce page that is made up of different components. One of my components is passed in a Case and displays the case fields. If there is an edit to the case I would like to save it with ...
0
votes
1answer
810 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....
-3
votes
1answer
39 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
1answer
307 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 ...
2
votes
3answers
2k 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 ...
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 ...
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
538 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
526 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
1k 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
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 ...
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: ...