Questions tagged [dynamic-visualforce]

Dynamic Visualforce components offer a way to create Visualforce pages that vary the content or arrangement of the component tree according to a variety of states, such as a user’s permissions or actions, user or organization preferences, the data being displayed, and so on. Rather than using standard markup, dynamic Visualforce components are designed in Apex.

Filter by
Sorted by
Tagged with
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 ...
12
votes
1answer
20k views

reRender outputPanel from javascript function in visualforce

I want to reRender "TopPanel" from javascript, is there any way to do this in visualforce ? <apex:outputPanel id="TopPanel"> <apex:outputPanel> <script type="text/javascript"> ...
12
votes
3answers
12k views

Hide the whole empty row of table in VF page when rendered as pdf

I am showing object fields by using <table>,<tr> and <td> tags in page to show the details in some format. I am using following condition to show data on the page, if field is not ...
11
votes
1answer
7k views

The “Escape” in visualforce javascript remoting

The description said the option allows user to determine whether to escape the Apex method’s response. And, actually, it doesn't "escape" the respone, but "encode" or "not encode" the response. Am I ...
10
votes
6answers
14k views

I have api objectfield name, how can I get the label?

Im working in a site, And I need to present many fields to be filled and the page, so accoding to a selecction before, I have all the field but I have the Api Name, and the object name, but, With this ...
10
votes
4answers
7k views

How can I get picklist values using Dynamic Visualforce Bindings?

I'm currently gathering metadata on fields using a controller and was investigating using Dynamic Visualforce Bindings instead. I can see that I can iterate through a controller-supplied list of ...
10
votes
2answers
6k views

apex:inputField on Lookup Values

I'm trying to build out a flexible, custom search engine as a component, but am stuck. I want to be able to specify filter fields in a comma delimited input attribute (strFilterFields in my code) and ...
10
votes
2answers
1k views

Adding visual force page to a custom object based on criteria

There is a custom object called Competitor. For this object there is a field called "Primary Competitor (Data type:Check Box)". Requirement:if primary competitor=checked-->then before saving it has ...
9
votes
4answers
23k views

How to refresh the parent page after a Save action in a Visualforce page embedded in a page layout?

I am trying to complete a VF page section that my sales-staff will be utilizing to add information to custom fields when a condition is met inside of the Account object. I have the custom page built ...
9
votes
2answers
4k views

How do I create a dynamic list in Visualforce

I want to create a view of certain custom fields and objects, with the data for the view computed in a controller with input from SOQL statements from custom objects. The view would consist of several ...
9
votes
2answers
2k views

Field Values In Dynamic Component Not Retaining After Error

I updated the question due to the issue being specifically for a dynamic component Currently, I have a custom VisualForce page used to fill out a new Opportunity. Everything works as intended except ...
9
votes
4answers
2k views

How do I unit test an Apex controller method for dynamic components?

I have an Apex controller method that returns a Component.Apex.OutputPanel for use in a <apex:dynamicComponent /> tag. How do I do a unit test that asserts that the controller is outputting the ...
8
votes
1answer
1k views

apex:dynamicComponent - Correct type of a component

Situation I want to implement a dynamic, dynamic custom component in visualforce and apex. Therefore I created a new component: <apex:component controller="SidebarController"> <apex:...
8
votes
1answer
581 views

Dynamic Visualforce Components - Access Pass-Through Attributes

Is it possible to use html-pass-throug attributes at Dynamic Visualforce Components? Component.Apex.InputField result = new Component.Apex.InputField(); result.style = 'font-size: 9px'; result.title ...
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" ...
8
votes
2answers
1k views

System.VisualforceException: Invalid value for property label: null

Sigh. So I am required to cover my Apex code with tests. I'm testing a piece of code that dynamically builds a tree of controls with a PageBlock as the root object. This code works fine when NOT ...
8
votes
3answers
2k views

What are good design patterns for dynamic visualforce components for a data-driven input form?

I am designing a custom input form that will be data-driven and will display things like input fields, input text components, custom inputs that I create, etc. The elements on the form will be largely ...
8
votes
4answers
7k views

Display the fields properly in output panel while using actionRegion

I am using actionRegion for to show/hide the fields based upon picklist in Opportunity. When i am selecting the Stage picklist value is Closed Lost, then 4 text fields will be displays. It works fine. ...
7
votes
2answers
6k views

Add more than 1000 picklist values in visualforce page (controller 1000 list items limit)

I have following code - Page - <apex:selectList value="{!selectContactId}" multiselect="false" size="1" id="RelatedContact"> <apex:selectOptions value="{!relatedContacts}"/> </...
7
votes
2answers
1k views

<apex:relatedList list=“{!DontExistInAllOrgs__c}”/ > only solveable with Dynamic Vf components?

Does there exist a dynamic binding mechanism for the list attribute in the <apex:relatedList> element? I want to display a related list for a relationship that does not exist on all orgs where ...
7
votes
3answers
7k views

Loading a custom component into a Visualforce page dynamically

I have a visualforce page that I would like to inject custom components (header and footer) if they exist into the page. According to the docs Creating and Displaying Dynamic Components I can ...
7
votes
2answers
2k views

Not getting how FieldSet works in Salesforce

Please have a look at these 2 code snippets: (1) <apex:page id="pageId" standardcontroller="My_Object__c"> <apex:form id="formId"> <apex:pageblock id="pbId"> <...
7
votes
1answer
294 views

FinancialForce component ? What are they ? how do they work?

I recently came across a custom financial force component <ffirule:IntegrationRule engine="{!engine}"/> which is very similar to custom visualforce components but don't they usually start with ...
7
votes
1answer
4k views

Visualforce Page with required fields and rerendering

We have a Visualforce page that uses standard pageBlockSections and inputFields. This page has a lot of dynamic rerendering of pageBlockSections based on fields. Up until now, all of the fields have ...
6
votes
1answer
3k views

Dynamic Visualforce Components post back values

If I add an Component.Apex.InputText to a Visualforce page using dynamic Visualforce components how can I see the value that is entered in that component when the user submits the page back via a ...
6
votes
2answers
689 views

apex:detail title bug?

I've looked everywhere and it seems like I'm the only one with the problem. I've created a visualforce page and use apex: detail to reference my object. Everything shows up fine but I don't want ...
6
votes
2answers
379 views

URLFOR/Component.Apex.OutputText in Unit Test causing Internal Server Error?

Background I'm trying to build the usual "URL hack" to default some field values when a new record is created. This is a simple override that basically has a page like: <apex:page ...
6
votes
1answer
3k views

Apex form load select list based on selected item in previous select list

I have a VisualForce / Apex form. There is a dropdown SelectList input field for object. I want to load the list of fields for the selected object in a second select list on the same form. I've ...
6
votes
3answers
9k views

Bind a radiobutton to controller

I have a pageBlockTable that gets its items from a database list from the controller I'm trying to add in that pageblockTable a column for radiobuttons so the user can select only one row. I tried ...
6
votes
1answer
15k views

Formatting number values on Visualforce page

I am wondering if it is possible to dynamically format input numbers in Visualforce components when rendering as HTML. I am able to successfully accomplish this when rendering as output tags doing the ...
6
votes
1answer
171 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 ...
6
votes
1answer
4k views

Dynamic Picklist Values by RecordTypes? [duplicate]

I've searched high and low and can't seem to find any posts or blogs showing how to get picklist values for a particular recordType to use in a custom controller. I can easily obtain the RecordType ...
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> ...
5
votes
4answers
109 views

Is it possible to get the label or describe from an SObjectTypeToken?

In my controller, I have some SObjectType property: public SObjectType myProperty { get; private set; } I want to get the label (or better yet the entire describe) of this object in Visualforce ...
5
votes
1answer
6k views

To achieve Grand total for the retrieved column in a datatable generated using Soql

I have created a VF tab in which i have retrieved the data with a SOQL statement and displayed the same with VF page using a datatable to make it as a customized report. I can't find a proper solution ...
5
votes
1answer
2k views

Visualforce error Not Serializable: Component.flow.interview

i am using dynamic Visualforce component created in Apex public with sharing class Sample3 { public Component.Flow.Interview flow{get;set;} public Sample3(){ flow= new Component.Flow....
5
votes
1answer
2k views

How to create nth level tree hierarchy structure in salesforce?

I have a Product XML with parent,childs,grandchilds....upto nth level. I want to parse this xml & create a tree structure out of it & display in vf page. I saw an example of accounts,contacts &...
5
votes
1answer
597 views

sObject Required Field with Dynamic Apex

I'm trying to find required fields for lead object, I want to make sure this correct logic, because its giving field results which are not marked as required.I'm using isNillable() method in field ...
5
votes
1answer
248 views

Visualforce dynamic rendering based on Object Type

Imagine you have a collection of classes all extending a base type: public abstract class Vehicle{ public Position position{get; private set;} public String make {get; private set;} public ...
5
votes
1answer
2k views

Dynamically load a custom component in Visualforce page

I have a custom component called MyComponent that I could add to my visualforce page by using <c:MyComponent />. This is done in a static manner i.e. I need to have it in my visualforce page ...
5
votes
1answer
2k views

how to make selected radio button as checked?

depending upon the selection of radio button it displays the selected row in differnt fields. the selected radio button disappears after the selected row splited.but i want the radio button selected. ...
4
votes
1answer
1k views

How to catch internal Salesforce error in APEX?

I have a condition where i have to get a list of valid custom label names in a list using which i can display those custom labels dynamically on the page. But whenever i am checking if the custom ...
4
votes
4answers
5k views

How to extract a number from a string

Im a newbie in Apex and im developing a page using Visualforce. My string format is always like this "xx-xx-999999". In this format I need to get only the integer. For example the string is "RO-W1-...
4
votes
1answer
2k views

Search functionality in Visualforce Page

I am building a simple search functionality which can search records in salesforce using the record name. The search should happen as I key in the letter in search box. I searched in google a bit and ...
4
votes
1answer
2k views

Javascript to calculate total at row and column level

I have a pageblocktable with one editable column in which numeric value for quantity will be entered. the next column to this is the Rate column which will have values from Salesforce. I want the ...
4
votes
2answers
813 views

How to show Columns of Visualforce Page Based on Custom Settings Fields?

So I got my Visualforce Page to display a table with columns (e.g. Version, Date, Type, etc.) as well as values from a dataset for each corresponding column of the next rows. I'm trying to integrate ...
4
votes
1answer
126 views

Get display name of the VF page through expression with $Page

Is it possible to get the display name of the visualforce page via expression like {!$Page.vfpage.name} or there are other simmilar ideas how to achieve this?
4
votes
1answer
1k views

OutputPanel Not Serializable with DynamicComponent

I'm having an issue trying to use dynamicComponent. I'm trying to display an outputPanel, but getting a SerializationException. I'm trying to accomplish this with the following code: In my page I ...
4
votes
4answers
3k views

SObject row was retrieved via SOQL without querying the requested field

I've been trying to understand the example at http://www.salesforce.com/us/developer/docs/pages/Content/pages_dynamic_vf_sample_standard.htm#pages... This is from VF Developer's Guide. I have no ...
4
votes
2answers
971 views

Variable number of cells over fixed # of columns in VF

I want to render up to 9 images in a panel, where each image is a commandlink. There is logic in the controller that determines which images/values are appropriate in the given context. I have the ...