-
ChatterFeed
-
34Best Answers
-
0Likes Received
-
0Likes Given
-
1Questions
-
689Replies
pop-up alerts possible?
Hi,
I am new to salesforce. And am planning to create a hotel management system.
Suppose there are four types of roles: Client, waiters, chefs and managers.
What i want is that whenever a client pays a bill amount greater then a predefines value, a alert should pop-up in front of all logged-in managers. Is this possible? Are there any work arounds for this ?
I know that email alerts are possible in this scenario. But i would prefer a pop-up alert.
Thanks in advance,
arun.
- arunk
- June 09, 2009
- Like
- 0
- Continue reading or reply
Two instances of a component on one page - only one seems to process?
I wrote a basic component that renders data in an HTML tag, which you can pass as an attribute on the component. Ultimately, this will we be much more sophisticated, but I can't even get this working when I put two of the same component on one Visualforce page. The first component renders, but the second appears to be ignored. We're working on a lightweight CMS for Visualforce, so it would not be unrealistic to have multiple instances of the same component rendered multiple "content blocks" into one final page.
COMPONENT:
<apex:component controller="CTRL_COMP_cms_content">
<apex:attribute assignTo="{!wrap}" name="wrap" description="The HTML tag to wrap this component with." type="String" required="false" />
<apex:attribute assignTo="{!text}" name="text" description="The text to put in the tag." type="String" required="false" />
<apex:outputText value="{!output}" escape="false" />
</apex:component>
CONTROLLER:
public class CTRL_COMP_cms_content {
public String wrap {
get {
if(wrap == null) wrap = '';
return wrap;
}
set;
}
public String text {
get {
if(text == null) text = '';
return text;
}
set;
}
public String output {
get {
if(wrap == '') return text;
return '<' + wrap + '>' + text + '</' + wrap + '>';
}
}
public CTRL_COMP_cms_content() {}
}
PAGE WITH COMPONENTS:
<apex:page id="the-page">
<c:cms_content id="text1" text="First Text" wrap="div"></c:cms_content>
<c:cms_content id="text2" text="Second Text" wrap="div"></c:cms_content>
</apex:page>
FINAL RENDERED HTML OUTPUT:
<span id="the-page:text1"><div>First Text</div></span>
<span id="the-page:text2"></span>
The final HTML output includes the results from the first component and renders the <span> for the second component, but the contents of the second component are never rendered.
Help!
- patros
- June 05, 2009
- Like
- 0
- Continue reading or reply
How to include image from external site in page that render as pdf
It is image (<apex:image> or <img>) in Visualforce page. When I tried render it as pdf, image is corrupted (image doesn't load...). It's bug??
How to insert external image in VFP that render as pdf??
- _LSDsl_
- May 27, 2009
- Like
- 0
- Continue reading or reply
bug in Spring '09: intermittent "inputField can only be used with SObject fields" error
Starting in the Spring '09 release, one of our pages is throwing this error intermittently. I've run across it randomly - attempts to reproduce it have failed, but I've seen it more than once - and our customers are reporting the same thing.
Here's the error:
This error is new in Spring '09. We've never seen it before, despite the exact same code running.
My understanding is that this error should be thrown if <apex:inputField> is used for an Apex object instance var rather than for an SObject field. As can been seen from the error msg itself, our accessor chain does in fact end with an SOBject field. Maybe the fact that there are a couple accessors in the chain is the problem? Hard to say, as the error only strikes randomly - the code works most of the time.
The relevant code bits are, on the page:
<apex:dataTable value="{!pendingPager.matchOne}" var="each">
...
<tr class="if nc nl"><td>First Name</td><td><apex:inputField value="{!each.addr.FirstName__c}"/></td></tr>
and on the controller:
global class PagerPending extends PagerBase {
...
// inner class
global class Item {
public EmailAddr__c addr;
global EmailAddr__c getAddr() { return addr; }
}
}
Salesforce - I've created support case 02472586 to track this issue.
- jhart
- February 26, 2009
- Like
- 0
- Continue reading or reply
JavaScript in VisualForce
Please help me on calling a JavaScript in VF page
I tried below options
<script type="text/javascript" src="{!URLFOR($Resource.myscript,'/test.js')}"/>
where 'test' is a javascript file saves in zip file named myscript in Static resources
<apex:includeScript value="{!$Resource.tstres}"/>
<script type="text/javascript" src="{!$Resource.tstres}"/>
where tstres is javascript file saved directly in static resources.
The script is
<script type="text/javascript">
document.write("Hello World!")
</script>
if I write the script directly in the page editor its printing Hello world.
But its not working with, includescript .
Its not showing any error.
Thanks in advance
- visualforce_dev
- February 25, 2009
- Like
- 0
- Continue reading or reply
VF page errors when rendering as pdf since the Spring 09 update
I have a custom button where I generate a VF page as a PDF with the renderAs="pdf" option by passing parameters via the query string like this:
/apex/QuotePDF?quoteid={!Quote__c.Id}&oppid={!Quote__c.OpportunityId__c}&ownerid={!Opportunity.OwnerId}
Since the Spring 09 update, this has stopped working and gives a "Attempt to de-reference a null object" error. It appears that a value is not being populated but I am passing the VF page the necessary information needed to generate. I didn't see any mention of changes to renderAs for Spring 09. If I remove the renderAs="pdf" from the VF page, it displays without issues. Appreciate all ideas and insights.
- DuFrey
- February 10, 2009
- Like
- 0
- Continue reading or reply
rendered attribute is not working
Following is the code, I am printing the value of {!noOfBids} just to make sure that function in controller is working fine and returning the correct value. It does return a value which is greater than 0, still the block does not show up. If I remove this condition, it shows fine. Is this a Bug or I am doing something incorrect.
{!noOfBids} <apex:pageBlock rendered="{!noOfBids} > 0"> <apex:pageblockTable value="{!formalBids}" var="bids" border="2" width="100%" > <apex:column .... /> <apex:column .... /> </apex:pageblockTable> </apex:pageBlock>
- Sharad
- February 08, 2009
- Like
- 0
- Continue reading or reply
Using 1 controller for 2 Pages ..
Folks,
Probably a dumb question -- is it a bad practise to use 1 controller for 2 different visualforce pages ? 1 page is a main page & the other is a pop-up from the main page.
Pls advise.
Thanks.
- Arun Bala
- February 08, 2009
- Like
- 0
- Continue reading or reply
Thousand's separator ..
Folks,
I have a decimal which I need to display with thousands separator on a visualforce page. An outputText displays that value.
E.g: now it is 5360. I wanted it to be displayed as : 5,360
Any suggestions or ideas on how can I convert the decimal to the currency format ?? unforunately, I cannot use the exact sObject field as I am using a wrapper class.
Thanks folks.
- Arun Bala
- February 06, 2009
- Like
- 0
- Continue reading or reply
Uploading spreadsheet and images
Is there a way to upload images and spreadsheets in salesforce. Through the static resources we can upload image one at a time. But I am looking for a way to build a custom wizard for bulk upload. Is there a way to do it in visual force?
Thanks in advance.
- Dipa
- February 04, 2009
- Like
- 0
- Continue reading or reply
When referencing account.name with inputField, you must select isPersonAccount in your SOQL query
I have been following the cookbook and would like to add fields to edit objects on my visual force page. I have used the following code:
<apex:pageBlockSectionItem > <apex:outputLabel value="Name"/> <apex:inputField value="{!account.name}"/> </apex:pageBlockSectionItem>
and the apex:
public Account getaccount() { return [select id, salutation, name from Account where id = :System.currentPageReference().getParameters().get('id')]; }
it brings up the error:
When referencing account.name with inputField, you must select isPersonAccount in your SOQL query
I have tried using SOQL that selects isPersonAccount = true but this doesn't seem to fix the proble, what is the error asking for?
Thanks
Pete
- Peter Kemp
- February 04, 2009
- Like
- 0
- Continue reading or reply
Links in Visualforce Page Rendered as PDF
- JoshVH
- February 03, 2009
- Like
- 0
- Continue reading or reply
"SObject row was retrieved via SOQL without querying the requested field" for Owner field
I have an extension on a standard controller for my object GP_Bill_Item__c. Creating new entry works ok, but when I use this VF page for editing I get the above error when accessing Owner field from extension code. I know there is an optimization in field loading for edit as expressed in other topics, but no matter what I put in hidden output on VF page the owner does not seem to get loaded:
<apex:outputText value="{!billItem.Owner}" rendered="false"/>
I tried different variations for this field but nothing seems to get the owner loaded. What am I doing wrong?
The code that fires an error:
public extension_GPBillItem(ApexPages.StandardController stdController)
{ this.billItem = (GB_Bill_Item__c)stdController.getRecord();
// initial setup
if (billItem.Owner == null) { billItem.OwnerId = UserInfo.getUserId(); }
}
- mmix
- February 02, 2009
- Like
- 1
- Continue reading or reply
Issues attaching PDF to Opportunity
So I have two pages that share the same controller. On the first page you enter you inputs and the second page rendered as a PDF has all of you outputs. Before Spring '09 something like this wouldn't have worked.
It now works fine if you direct a user straight to that page but if you try to get the content of the page and turn it into an attachment it does not work.
Here is the code:
Page 1: pdfCreate
<apex:page controller="pdfIssues">
<apex:form >
<apex:inputText value="{!yourName}"/><br/>
<apex:commandButton value="View PDF" action="{!view}"/>
<apex:commandButton value="Attach PDF" action="{!attach}"/>
</apex:form>
</apex:page>
Page 2: pdfView
<apex:page controller="pdfIssues" renderAs="pdf">
<apex:outputText value="{!yourName}"/><br/>
</apex:page>
Controller:
public class pdfIssues {
public String yourName {get; set;}
public PageReference view() {
PageReference pdf = Page.pdfView;
return pdf;
}
public PageReference attach() {
Id oppID = [select Id from Opportunity limit 1].Id;
PageReference pdf = Page.pdfView;
Blob pdfContent = pdf.getContent();
Attachment doc = new Attachment(
ParentId = oppID,
Body = pdfContent,
Name = yourName +'.pdf',
ContentType = 'application/pdf'
);
insert doc;
return new PageReference('/'+doc.Id);
}
}
If you click the View PDF button everything works great, controller state is maintained and the PDF is rendered successfully. If you clikc the Attach PDF button you will be returned to the attachment but when you try to view it there will be an error.
This is a simplified example but in my more complex page this is some additional strange behavior. It will execute the Attach() method 4 times and insert four PDFs, non of which can be opened.
-Thanks,
Jason
- TehNrd
- January 31, 2009
- Like
- 0
- Continue reading or reply
An internal server error has occurred
An internal server error has occurred
An error has occurred while processing your request. The salesforce.com
support team has been notified of the problem. If you believe you have
additional information that may be of help in reproducing or correcting
the error, please contact support@salesforce.com.
Please indicate the URL of the page you were requesting, any error id
shown on this page as well as any other related information. We
apologize for the inconvenience.
Thank you again for your patience and assistance. And thanks for using Salesforce!
Error ID: 1973761023-277 (48984707)
I'm terrified by this error .. I get this when I fire Save from VF page created using TASK standard Controller.
whenever this error pops up, it just display a Full WHITE page with the Above Specified Error text, and Nothing Else.
- VarunC
- January 23, 2009
- Like
- 0
- Continue reading or reply
How to redirect to VF Page from S-Control
I have a list button, on click of it I am sending the selected records IDs to the apex class by using the s-control.
In that apex class I am getting these rows, I want to display these records in that VF, how can I redirect it to VF.
When I am redirecting using s-control view state is getting refreshed,So I am not getting any records.
If I am trying to return through webservice method it is showing an error like Invalid return type: System.PageReference
- hisrinu
- January 23, 2009
- Like
- 0
- Continue reading or reply
Rerender in a custom component not occuring when actionRegion tag present
I have a component that performs a rerender on the change of a picklist. If this code is used in a page it works perfectly. If I use the exact same code in a custom component the rerender is no longer being performed. Below is the code to reproduce:
Page:
<apex:page >
<c:componentIssue />
</apex:page>
Component:
<apex:component controller="componentIssue">
<apex:form >
<apex:actionRegion>
<apex:selectList value="{!picklistValue}">
<apex:selectOption itemValue="hide" itemLabel="hide"/>
<apex:selectOption itemValue="show" itemLabel="show"/>
<apex:actionSupport event="onchange" rerender="table"/>
</apex:selectList>
</apex:actionRegion>
<apex:pageBlock >
<apex:outputPanel id="table">
{!showTable}
<apex:pageBlockTable value="{!Accts}" var="a" rendered="{!showTable}">
<apex:column value="{!a.Name}"/>
</apex:pageBlockTable>
</apex:outputPanel>
</apex:pageBlock>
</apex:form>
</apex:component>
Controller:
public class componentIssue {
public String picklistValue {get; set;}
public List<Account> getAccts(){
return [select Name from Account limit 10];
}
public Boolean getshowTable(){
Boolean showTable;
if(picklistValue == 'show'){
showTable = true;
}else{
showTable = false;
}
return showTable;
}
}
If you remove the actionRegion tags from the component it works, unfortunelty I need these tags.
Thanks,
Jason
- TehNrd
- January 21, 2009
- Like
- 0
- Continue reading or reply
CommandButton & oncomplete ..
Have anyone ever tried to use the oncomplete attribute on a command button ? I am facing one weird issue.
<apex:commandButton styleClass="btn" value="Save" action="{!saveAction}" id="save" oncomplete="checkError();"/>
Now on click of the button when the save action fails as a result of some required fields not filled in, the fields are not getting highlighted as they would typically. When I remove the oncomplete definition, they get highlighted. My gut feeling is that our own definition of oncomplete overrides something that salesforce has defined for commandButton on completion of an ajax request. Any takers ??
Thanks.
Message Edited by Arun Bala on 12-30-2008 08:14 PM
- Arun Bala
- December 31, 2009
- Like
- 0
- Continue reading or reply
How to dynamically display SObject in a VF page?
I'd like to dynamically render an Sobject to a VF page.
Here is my controller:
private list<SObject> obj;
public void setobj(list<SObject> s){obj=s;} public list<Sobject> getobj(){return obj;}
public PageReference init() {
obj=[select Name from Account limit 10]; return null; }
Here my VF Page:
<apex:page Controller="Test" action="{!init}"> <apex:form> <apex:repeat value="{!obj}" var="field"> <apex:inputField value="{!field.Name}"/> </apex:repeat> </apex:form> </apex:page>
I've got this error message :
Read access not found for null.I've also tried with outputText, inputText with no success.The only field I've managed to retrieve is the ID.
Any Idea ?
- Yonathan
- December 28, 2009
- Like
- 0
- Continue reading or reply
Passing Parameters from Visualforce Page to Controller methods
Am I allowed to pass a parameter from my visualforce page to a controller method?
I want to create a method which returns boolean TRUE or FALSE depending on if the related list contains any records. I'm trying to avoid creating 15-20 get/set methods.
VisualForce Page Segment: <apex:page standardController="Account" extensions="AccountHiddenListControllerExtension"> </apex:detail> <apex:relatedList list="contacts" rendered="{!doesRelatedListExist('contacts'}">> </apex:relatedList> <apex:relatedList list="ActivityHistories" rendered="{!doesRelatedListExist('ActivityHistories'}">> </apex:relatedList> </apex:detail> </apex:page> Controller class: public boolean doesRelatedListExist(String listName) { if (listName.equals('contacts')) { return ((this.getContactList().size()) > 0); } if (listName.equals('ActivityHistories')) { return ((this.getActivityHistoriesList().size()) > 0); } // default value return true; }
The controller saves correctly; however, i get the following error message when saving the visualforce page:
Error: Unknown function doesRelatedListExist. Check spelling.
Thanks in advance.
Message Edited by wsthesis on 12-25-2008 06:26 PM
- wsthesis
- December 25, 2008
- Like
- 0
- Continue reading or reply
Release Note: Changes in apex:selectXXX
There have been a several changes to Visualforce between the Summer '07 and Winter '08 releases. A few naming changes have happened that might cause your pages not to view or compile. The following components have been renamed:
SelectItem is now SelectOption, for consistency with Apex Code.
SelectItems is now SelectOptions
SelectOneRadio is now SelectRadio
SelectManyCheckbox is now SelectCheckboxes
Additionally, selectManyListbox and selectOneListbox have been merged into the component selectList. By default, your selectList will behave like selectOneListbox, unless you define multiselect="true" in your selectList component. This will give your selectList the same functionality as selectManyListbox.
Message Edited by dchasman on 11-05-2007 04:41 PM
- dchasman
- November 05, 2007
- Like
- 0
- Continue reading or reply
Help! Visualforce equivalent of S-Controls
[Preface: as of today, all of our organizations' S-Controls which used 'http://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js' do not work! This means that we must convert all of our S-controls procedures (about 20) to APEX during this weekend! Why did this happen? Without a warning? Note that we are not the only ones. See here]
Could you please help on the following matters?
I have a link in Accounts, which runs an S-control that creates a new Opportunity with some data prefilled. How can I create this in APEX-Visualforce? Create a custom link with on-click Javascript? How can I create an APEX controller + Visualforce page that:
1) gets some values from the current Account page? (old way: var AccountName = "{!Account.Name}";)
2) creates a new Opportunity object and fills in some fields
3) Saves the new Opp and redirects the browser to the new Opp page?
Thank you for your help!
Alex
- alexannnic
- June 26, 2009
- Like
- 0
- Continue reading or reply
Help! Two underscores in url parameter is giving an "Insufficient Privileges" Error
Hello everyone,
I'm currently working with customer portal, don't know if this also happens outside of Customer Portal, but when I have a paramter in the url that has double underscore, suchas as theparam=thevalue__x, I get an Insufficient Privileges Error.This was not happening yesterday...
Any idea on why this is happening?
Thanks in advance.
- jonathanrico.
- June 24, 2009
- Like
- 0
- Continue reading or reply
Visual force page error
We have several Visualforce pages being used in our org. These were working okay until evening of 20th. But now few of them are showing the following error
Tag library supports namespace: http://salesforce.com/standard/components/apex, but no tag was defined for name: form
I checked through the forums for a solution and found that salesforce is working on fixing this. Would like to know if this is fixed or to whom should we report this to.
Thanks
KD
- kdmr
- June 22, 2009
- Like
- 0
- Continue reading or reply
NullPointerException trying to use a VF component from a managed package
I'm getting a NullPointerException when trying to save a page that references a VF component from a managed package. This seems to have broken since the Summer 09 release. Has anyone else seen this? Does anyone have workarounds?
- james2000
- June 11, 2009
- Like
- 0
- Continue reading or reply
Rendered PDF not support Calibri font
Hi all
I have used this code for my pdf out put.Except Calibri all the fonts works fine.
But if I specify Calibri then the font type changes to default font of pdf or something else.
<style>
body {
font-family:Calibri;
font-size:65%;
}
</style>
- Mrutyunjay
- June 11, 2009
- Like
- 0
- Continue reading or reply
Visualforce Page takes AGES to load in Production (c.eu0.visual.force.com)
Hi,
I've created a simple Visualforce page and a simple controller. I've created a Web tab and pointed it at the page's url. Clicking on the tab simply gives a list of our org's unread emails related to Cases. Most times it takes over 30 seconds to load and render, even though it's only returning 20 or so rows at any given time.
The page:
<apex:page controller="emailController" tabstyle="emailmessage" sidebar="true"> <apex:pageBlock > <apex:pageBlockTable value="{!emails}" var="m"> <apex:column headerValue="Case" value="{!m.ParentId}"/> <apex:column headerValue="Closed" value="{!m.Parent.IsClosed}"/> <apex:column headerValue="Received" value="{!m.messagedate}"/> <apex:column headerValue="Owner" value="{!m.Parent.Owner.Name}"/> <apex:column value="{!m.fromaddress}"/> <apex:column value="{!m.toaddress}"/> <apex:column value="{!m.subject}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>
The controller:
public class emailController { List<EmailMessage> emails = [select id,ParentId, Parent.Owner.Name,Parent.IsClosed, Parent.ClosedDate,status,fromaddress,toaddress,messagedate,subject from emailMessage where status ='0' order by Parent.IsClosed asc, messagedate desc ]; public List<EmailMessage> getEmails() { return emails; } }
What could possibly be causing a 30-second delay on this? I'm not saying that Salesforce.com performs that fantastically in the best of times for those of us on European instances, but 30 seconds for such a simple page is a little bit absurd.
Any input is greatly appreciated!!
- RDN_LHR
- June 10, 2009
- Like
- 0
- Continue reading or reply
visualforce pages stopped working - Tag Library supports namespace
We have lot of visualforce pages and they have stopped working.
getting following error:
Tag Library supports namespace: http://salesforce.com/standard/components/apex, but no tag was defined for name: sectionHeader
they were working yesterday.
- dggg
- June 09, 2009
- Like
- 0
- Continue reading or reply
Upgrade error?
Hi,
Anybody come across this error before?
"Tag Library supports namespace: http://salesforce.com/standard/components/apex, but no tag was defined for name: form"
This appears to have started when our development accounts have been updated to Summer '09. I can't now upload an already created managed package. I have got around this before by creating a new page with EXACTLY the same content as one that doesn't work; the new one works fine.
I get this when the existing page has an apex:form tag in it.
Thanks for any help.
Rich.
- Richie D
- June 09, 2009
- Like
- 0
- Continue reading or reply
pop-up alerts possible?
Hi,
I am new to salesforce. And am planning to create a hotel management system.
Suppose there are four types of roles: Client, waiters, chefs and managers.
What i want is that whenever a client pays a bill amount greater then a predefines value, a alert should pop-up in front of all logged-in managers. Is this possible? Are there any work arounds for this ?
I know that email alerts are possible in this scenario. But i would prefer a pop-up alert.
Thanks in advance,
arun.
- arunk
- June 09, 2009
- Like
- 0
- Continue reading or reply
Tag Library supports namespace, but no tag was defined for name: attribute
My Visual force page is using custom components created in the same org. Till yesterday the page was working fine but all of sudden today I am getting this error when I open this page.
Tag Library supports namespace: http://salesforce.com/standard/components/apex, but no tag was defined for name: attribute
Another trivial but strange thing thats happening is that, I can't open a
component in view mode. On trying to view the component from Setup >
Develop > Components. Following salesforce error comes, though we can edit
the component :)
Thank you again for your patience and assistance. And thanks for using Salesforce!
Error ID: 299154357-472 (-607383983)
I am getting couple of these wierd errors recently, like I get same error on "Run All Tests".
Does this means that latest salesforce upgrades are not stable and worth installing ?? I tried removing the custom components, still the error is coming.
Please help !
- abhinavgupta19
- June 09, 2009
- Like
- 0
- Continue reading or reply
Error: The value attribute on <apex:outputText> is not in a valid format. It must be a positive number, and of type Number, Date, Time, or Choice.
I am using an outputText tag along with a param tag to format a date file. This works quite well in the sprin'09 release. I get compile errors in Summer '09. Here is a simple page that works in spring'09 but gets an error on save in the summer '09 release.
<apex:page >
<h1>Congratulations</h1>
This is your new Page
<apex:outputText value="{0,date, MMMM d', 'yyyy}">
<apex:param value="{!NOW()}" />
</apex:outputText>
</apex:page>
The error message I get in summer '09 is below. Does anyone have any idea how to get around this? I have opened a case on this - the number is 02709898
Error: The value attribute on <apex:outputText> is not in a valid format. It must be a positive number, and of type Number, Date, Time, or Choice.
|
- DianeM
- June 08, 2009
- Like
- 0
- Continue reading or reply
XML Data into dataTable
Hello,
Just started using apex and VisualForce last week and I'm trying to get some XML data into a dataTable. I'm able to get the XML and parse it using the XmlStreamReader but I keep getting errors when trying to pass it to the dataTable. Here is my code. For now I'm just trying to get text from the usr_conference_id node but eventually I'd like to get the data from the other nodes.
The XML (I'm getting a valid XML doc but removed the header for this post):
<meeting>
<usr_conference_id>382718</usr_conference_id>
<conference_name>Test Conf.</conference_name>
<conference_user>Test User1</conference_user>
</meeting>
<meeting>
<usr_conference_id>381084</usr_conference_id>
<conference_name>Test Conf. 2</conference_name>
<conference_user>Test User2</conference_user>
</meeting>
<apex:page controller="Conferences">
<apex:dataTable value="{!conferencelist}" var="conf">
<apex:column>
<apex:facet name="header">ID</apex:facet>
<apex:outputText value="{!conf.usr_conference_id}"/>
</apex:column>
</apex:dataTable>
</apex:page>
public class Conferences {
public class UserConferences {
String usr_conference_id;
String conference_name;
} // End UserConferences
UserConferences[] parseXML(XmlStreamReader reader) {
UserConferences[] conferences = new UserConferences[0];
while(reader.hasNext()) {
if (reader.getEventType() == XmlTag.START_ELEMENT) {
if ('usr_conference_id' == reader.getLocalName()) {
reader.next();
UserConferences conference = new UserConferences();
conference.usr_conference_id = reader.getText();
conferences.add(conference);
}
}
}
return conferences;
} // End parseXML()
public List<Conferences.UserConferences> getConferenceList() {
Http http = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint('https:ADDRESS REMOVED');
req.setMethod('GET');
HttpResponse res = http.send(req);
// Generate the HTTP response as an XML stream
XmlStreamReader reader = res.getXmlStreamReader();
List<Conferences.UserConferences> conf_return = parseXML(reader);
return conf_return;
}} // End Conferences
When I try to save this in the page editor I get the following error:
System.Exception: Too many script statements: 200001
Class.Conferences.parseXML: line 21, column 13 Class.Conferences.getConferenceList: line 35, column 60 External entry point
Any help would be greatly appreciated!
Thanks,
Dan
- DDay
- June 08, 2009
- Like
- 0
- Continue reading or reply
Generating an XML from VF page using ContentType
Hello Friends,
My requirement is that, i need to generate an XML out of my VF page. For this, i specified the "ContentType="application/xml" on my page header and then included the DOCTYPE tags to generate a standard XML out of it.
But somehow, i am not able to get the XML styling in the generated page and it shows me the shole page elements intead of just showing me the data.
Can you please let me know where i am going wrong or is this possible in VF? Pasting my VF page code below:
<apex:page cache="true" Controller="TestController" contentType="application/xml" showHeader="false">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/html" xml:lang="en" lang="en">
<body>
<apex:form >
<apex:pageblock id="exportDocs">
<apex:pageBlockTable value="{!exportValues}" var="actual">
<apex:column headerValue="Id" value="{!actual.Id}"/>
<apex:column headerValue="Act Name" value="{!actual.Name}"/>
<apex:column headerValue="MType" value="{!actual.A_Type__c}"/>
<apex:column headerValue="Country" value="{!actual.Country__c}"/>
<apex:column headerValue="B" value="{!actual.B__c}"/>
<apex:column headerValue="Actual C" value="{!actual.C__c}"/>
<apex:column headerValue="Actual G" value="{!actual.G__c}"/>
<apex:column headerValue="Actual I" value="{!actual.I__c}"/>
</apex:pageBlockTable>
</apex:pageblock>
</apex:form>
</body>
</html>
</apex:page>
Any help/guidance would be highly appreciated!!
Many Thanks,
Cool_D- Cool_Devloper
- June 06, 2009
- Like
- 0
- Continue reading or reply
Two instances of a component on one page - only one seems to process?
I wrote a basic component that renders data in an HTML tag, which you can pass as an attribute on the component. Ultimately, this will we be much more sophisticated, but I can't even get this working when I put two of the same component on one Visualforce page. The first component renders, but the second appears to be ignored. We're working on a lightweight CMS for Visualforce, so it would not be unrealistic to have multiple instances of the same component rendered multiple "content blocks" into one final page.
COMPONENT:
<apex:component controller="CTRL_COMP_cms_content">
<apex:attribute assignTo="{!wrap}" name="wrap" description="The HTML tag to wrap this component with." type="String" required="false" />
<apex:attribute assignTo="{!text}" name="text" description="The text to put in the tag." type="String" required="false" />
<apex:outputText value="{!output}" escape="false" />
</apex:component>
CONTROLLER:
public class CTRL_COMP_cms_content {
public String wrap {
get {
if(wrap == null) wrap = '';
return wrap;
}
set;
}
public String text {
get {
if(text == null) text = '';
return text;
}
set;
}
public String output {
get {
if(wrap == '') return text;
return '<' + wrap + '>' + text + '</' + wrap + '>';
}
}
public CTRL_COMP_cms_content() {}
}
PAGE WITH COMPONENTS:
<apex:page id="the-page">
<c:cms_content id="text1" text="First Text" wrap="div"></c:cms_content>
<c:cms_content id="text2" text="Second Text" wrap="div"></c:cms_content>
</apex:page>
FINAL RENDERED HTML OUTPUT:
<span id="the-page:text1"><div>First Text</div></span>
<span id="the-page:text2"></span>
The final HTML output includes the results from the first component and renders the <span> for the second component, but the contents of the second component are never rendered.
Help!
- patros
- June 05, 2009
- Like
- 0
- Continue reading or reply
Does Salesforce Strip Cookies from the Header for PageReferences?
Hi,
I'm trying to use cookies with a visualforce page. I set the cookie with javascript but when I use System.currentPageReference().getHeaders() the returned map doesn't have a 'Cookie' key. Is this because salesforce strips them before they get to us and if so is there a reason for doing this?
Thanks!
Scott
- Scott.M
- March 18, 2009
- Like
- 0
- Continue reading or reply
Body of Visualforce email Template is missing.
<messaging:emailTemplate subject="New Web-to-Trial Request requires your Approval" recipientType="User" relatedToType="Opportunity"> <messaging:htmlEmailBody > <html> <body> <style type="text/css"> p.regular {font-family: arial; size: 8pt;} p.small {font-family: arial; size 8pt; line-height: 100%} </style> <p class="regular"> <br>A New Trial Request has been submitted.</br> <br>Account: <apex:outputLabel >{!relatedTo.Account.Name}</apex:outputLabel></br> <br><apex:outputText >Requested By: {!relatedTo.Contact__r.Name}</apex:outputText></br> <br>To approve, simply type 'Approved' in your response. You can also review the Opportunity or Approve online at https://emea.salesforce.com/{!relatedTo.Id}</br> </p> </body> </html> </messaging:htmlEmailBody> </messaging:emailTemplate>
Message Edited by AKall on 01-16-2009 01:26 PM
- AKall
- January 16, 2009
- Like
- 0
- Continue reading or reply
Cookie headers
I'm trying to pull the Cookie header out, but it never appears as a key in System.currentPageReference().getHeaders() map. I see lots of other headers there, but no cookies.
As it stands, to write a cookie-aware app I need to do it all in Javascript. (Write the cookie, read the cookie and post back to VF for the cookie's state to become part of the page state). Not ideal.
Thanks for any help.
- App_Dev1
- December 15, 2007
- Like
- 0
- Continue reading or reply