• s_foo
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 13
    Replies

Hi,

 

I am writing a f-test for an existing functional page in which  I am trying to get the page details but everytime I run my f-test its giving "VisualForce- Error". Plz find the code below

 

Any help on this is highly appreciated 

 

The contract insertion code is not adding here which is a part of ftest. 

 

static testMethod void testPageDetails(){

 

    PageReference ref = Page.TestPage;

     ref.getParameters().put('Id', contractId);

 

     String body = (ref.getContent()).toString();

     System.debug('***Details ::'+body)

 

 

}

 

Page

 

<apex:page controller="TestController" cache="false" title="FTest">
  <!-- Begin Default Content REMOVE THIS -->
  <h1>Congratulations</h1>
  This is your new Page :: {!contId}
  <!-- End Default Content REMOVE THIS -->
 
Billing Name : {!billingName}
</apex:page>

 

 

Controller

 

public class TestController {

String contId = null;
private Contract contract;

 

public TestController(){
contId = System.currentPageReference().getParameters().get('Id');

 
 this.contract = [Select BillingFirstName,BillingLastName
                  FROM Contract
                  Where Id = :contId];

}


public String getContId(){
 return contId;
}

public String getBillingName() {
 return contract.BillingFirstName+' '+contract.BillingLastName;
 }

}

 

P.S. The above Ftest works fine if I use the existing contract number from the App.

  • February 23, 2009
  • Like
  • 0

Hi,

 

I have a page which opens a excel . Till the time it is working fine but when the end users installed new version of MS-Office i.e. excel 2007, the current page started giving following warning

"The file you are trying to open, 'TestFile.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?"

 

Following is the code line which is generating my output in excel file.

<apex:page cache="true" contentType="application/vnd.ms-excel#TestFile.xls" controller="TestFileController" language="en_US">

 

Is there a way to get rid of this message? Any help on this is appreciated.

 

Thanx

 

S

  • February 02, 2009
  • Like
  • 0

I have a jsp page which is opening a apex page in a new window.  when some one clicks save on the apex page, the requirement is to save the changed data , close apex page window and refresh the calling parent.

 

Any help is highly appreciated.

 

P.S. I have tried window.top.close() which closes down the window without saving the data.

 

Thanx

 

S

  • January 26, 2009
  • Like
  • 0
 
I am trying to force groupings on the  form so they do not get split between pages.i .e. single section on the page will not split  into 2 different pages. Is there a way in visualforce to do so?
 
e.g.  The Address section is toward the end of the page and can not fit into that page then the whole section should moved to the next page.
 
Any help on this is highly appreciated.
 
 
Thanx
 
S
  • December 10, 2008
  • Like
  • 0
Hi,

I have a apex page which is opening a excel file. If the language is other than English then its not rendering the characters correctly.
If i saved the same file as .csv and opened it with different editor it opens nicely with localized values.

Is there anything which am missing here?

Any help on this is highly appreciated.

Thanx

S
  • September 10, 2008
  • Like
  • 0

Hi,

I tried to run the sample code given in the Visual Force Developer's guide in IE 7 and it didn't work for me. Is there anything i am missing here. I have used 'http' instead of 'https' as mentioned by Doug.

Any help on this is highly appreciated.

Thanx

S

  • August 12, 2008
  • Like
  • 0
Hi,
 
I have a apex page which has localized values for french,chinese and 12 other languages which are working fine but when it comes to japanese, it shows some weird characters  like " æ ±äº¬éƒ½æ¸¯åŒºå…­æœ¬æœ¨ãƒ’ãƒ«ã‚ºæ£®ã ", the localized value is correctly translated.
 
Any suggestion on this is highly aapreciated.
 
Thanx
 
S
  • July 31, 2008
  • Like
  • 0
Hi,
 
I have a apex page which has a link to excel page. when i click that it says "Could not Open http://store1/apex/excelview?startDate=7/22/2007&currencyType=EUR". 
The same page is opening in Firefox though.
 
<apex:page cache="false" contentType="application/vnd.ms-excel" controller="StoreController" language="{!userLanguage}">
 
Thanx
 
S
  • July 21, 2008
  • Like
  • 0
Hi,
 
I have a code which is sending a mail to the customer with the attachment . In the attachment(apexpage), i have 2 images which are not rendered when the attahment is opened. When i look at  the attachment page in the app, they look fine. Any thoughts are appreciated.
 
<apex:image url="{!$Resource.Logo}" />
 
 
Thanx
 
S
  • July 14, 2008
  • Like
  • 0
Hi,
 
I have a code which is sending a mail to the customer with the attachment . In the attachment, i have 2 images which are not rendered when the attahment is opened. When i look at  the attachment page in the app, they look fine. Any thoughts are appreciated.
 
<apex:image url="{!$Resource.Logo}" />
 
 
Thanx
 
S
  • July 14, 2008
  • Like
  • 0
I have a requirement where the user selects the old date but  i click on the inputfield , it showed the calendar but with the years onward 2008. Is there way to show the earlier years in the calendar
 
Thanx
 
S
  • July 14, 2008
  • Like
  • 0
Hi,
 
I have  scenario where i want to disable the inputField onload.
 
<apex:inputField id="sdate"   value="{!inputStartDate.Date__c}">

 
The value for input field is date.  Is there a way to do this?
 
Thanx
 
S
  • July 09, 2008
  • Like
  • 0

I have a Sites page that dynamically generates a PDF from a custom CMS. As part of that page, I would like to dynamically include certain images throughout, accessed from Static Resources, in sections of HTML generated by the Apex Controller through the use of <apex:outputText value="{!someGetter}" escape="false" />.

 

If the page is not set to renderAs="pdf", I can access Static Resource images in the return value of the Apex method like this:

 

return '<img src="resource/ResourceName">';

 

However, if I set renderAs="pdf" so that the page renders as PDF, the images show up broken. I've tried a few different ways of accessing the Static Resource, including the full URL, as well as linking to images off-site, like the Google Logo. I've even tried embedding the image into the text, using Base64. It seems like the only way to include an image in a PDF is to have it directly in the VisualForce page, which is inconsistent with the rendering of a regular VF page. Is this a bug, or is there some way to accomplish what I'm trying to do here?

 

Thanks,

Tom

Hi,

 

I have a page which opens a excel . Till the time it is working fine but when the end users installed new version of MS-Office i.e. excel 2007, the current page started giving following warning

"The file you are trying to open, 'TestFile.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?"

 

Following is the code line which is generating my output in excel file.

<apex:page cache="true" contentType="application/vnd.ms-excel#TestFile.xls" controller="TestFileController" language="en_US">

 

Is there a way to get rid of this message? Any help on this is appreciated.

 

Thanx

 

S

  • February 02, 2009
  • Like
  • 0

I have a jsp page which is opening a apex page in a new window.  when some one clicks save on the apex page, the requirement is to save the changed data , close apex page window and refresh the calling parent.

 

Any help is highly appreciated.

 

P.S. I have tried window.top.close() which closes down the window without saving the data.

 

Thanx

 

S

  • January 26, 2009
  • Like
  • 0
Hi,
 
I have a apex page which has a link to excel page. when i click that it says "Could not Open http://store1/apex/excelview?startDate=7/22/2007&currencyType=EUR". 
The same page is opening in Firefox though.
 
<apex:page cache="false" contentType="application/vnd.ms-excel" controller="StoreController" language="{!userLanguage}">
 
Thanx
 
S
  • July 21, 2008
  • Like
  • 0
Hi,
 
I have a code which is sending a mail to the customer with the attachment . In the attachment, i have 2 images which are not rendered when the attahment is opened. When i look at  the attachment page in the app, they look fine. Any thoughts are appreciated.
 
<apex:image url="{!$Resource.Logo}" />
 
 
Thanx
 
S
  • July 14, 2008
  • Like
  • 0
Hi,
 
I have  scenario where i want to disable the inputField onload.
 
<apex:inputField id="sdate"   value="{!inputStartDate.Date__c}">

 
The value for input field is date.  Is there a way to do this?
 
Thanx
 
S
  • July 09, 2008
  • Like
  • 0
Hello,
 
I am having difficulties attempting to run the Microsoft Excel ContentType example on page 43 of the Visualforce Developers Guide.  Is there anything incorrect in the example as shown in the guide? 
 
I am able to get satisfactory results using a few other contenttypes, such as (1) text/html, (2) text/plain, and (3) text/richtext, but Internet Explorer 7 cannot open or save the resulting file.
 
Has anyone any ideas to share about this?  Oh, yeah, I'm a newbie...
 
Thanks in advance.
  • March 20, 2008
  • Like
  • 0