• mackendw@gmail.com
  • NEWBIE
  • 50 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies

Hi:

 

   I have a VF section on Opportunity.  It has a button on the page to export the content as a pdf which is then attached to the opportunity.  The output is renderAs='pdf'.  Works fine with FF, Chrome....however, in IE 8 | 9 it complains that the file being opened when you click on the View File dialog is corrupt or broken.

 

   Any idea what is going on?

 

   Here is the code in the controller class that does the work:

 

    String attachmentName = 'outputPDF';

 

    Id oppId = apexpages.currentpage().getparameters().get('id');

    

    PageReference pdf = new PageReference('/apex/outputPDF?id='+oppId);

 

    pdf.getParameters().put('id',oppId);

     

    Blob pdfBlob = pdf.getContent();

 

    if (pdfName == null || pdfName.length() == 0)

       pdfName = attachmentName+'.pdf';

   

    Attachment saveAtch = new Attachment(ParentId = oppId, IsPrivate = false, ContentType = 'pdf', Name = pdfName, Body = pdfBlob);

 

    insert saveAtch;  

    

 

Note that the outputPDF VF page has renderAs='pdf' in the apex:page parameter.  Works in FF & Chrome, not in IE.

 

??

Hi:

 

   I'm using the Yahoo YUI toolkit simpleeditor component to capture via a pop-up window some remarks info.

 

   I have a button and associated inputTextArea field on the main page that holds the data field for the remark.  This is backed by a field with getter/setter methods in the controller class.

 

   In the pop-up page which uses YUI simpleeditor, the page renders fine and captures the rich text fine.  I attempt to post the contents that the editor collects using the following javascript function:

 

    function beforeTextSave()
    {
       var rem=myEditor.getEditorHTML();
       document.getElementById('{!$Component.remarksId}').value = rem;
    }

 

   I put an alert statement after the document to ensure it was capturing the data from simpleeditor OK and it was.

 

   The remarksId id refers to:

 

<div class="yui-skin-sam" style="display:none" id="editor" align="center" ><p />
    <apex:commandButton value="Save"  onclick="beforeTextSave();CloseWindow();"/>
 <apex:inputtextarea id="remarksId" rows="20" cols="75" value="{!remarks}" richText="true"/>

 

   What am I doing incorrectly here?  Should not the javascript be posting the updated editor data into the remarks field by virtue of me updating the component on the page by its ID.value?

 

thoughts??

 

I have a custom Visualforce page which extends from Opportunity.  In the page, I have a <apex:pageblockTable tag with an associated set of

columns within it.

 

I'm trying to set 2 of the 9 column headers in the headings row to a specific color....to no avail.

 

here is what I'm doing:

 

<style>

.list .headerStyle { background-color:#da1c00;text-align:center !important}

... clipped for brevity

</style>

 

...

...

 

<apex:pageblockTablevalue="{!Questions}" var="q" border="6" frame="box"  cellpadding="3" rules="cols" id="detailTable">

<apex:columnheaderValue="#" headerClass="grayClass">

<apex:outputFieldid="questionNo"  value="{!q.Question_Number__c}"/>

</apex:column>

 

<apex:columnheaderValue="Please answer the following questions by filling column D with numerical codes (1,2,3,4,5 or 6)" headerClass="headerStyle">

<apex:outputFieldvalue="{!q.Question_Text__c}"/>

</apex:column>

 

I also tried disabling the standardStylesheets as a parm tag to the <apex:page tag...didn't work either.

 

Any idea what I'm missing here?

 

thx.

Wendell

 

Testing a trigger that establishes account sharing rules via Apex.

 

Trigger logic is setting the AccountShare object values as follows:

 

                         AccountShare processorSharingRule = new AccountShare();
                         processorSharingRule.AccountId = acct.Id;
                        processorSharingRule.OpportunityAccessLevel = 'None';
                         processorSharingRule.CaseAccessLevel = 'Edit';
                        processorSharingRule.AccountAccessLevel = 'Edit';
                         processorSharingRule.UserOrGroupId = pdr_u.Id;
                         acctSharingRules.add(processorSharingRule);

 

Exception fires when this code executes:

 

                 if (acctSharingRules.size() > 0) {
                     upsert acctSharingRules;
                 }

 

I have output the values of the acct.Id and pdr_u.Id and both contain valid values.  So it looks to be a security

setup problem.

 

Account is setup: Private with Grant using Hierarchies

Opportunity is setup: Private with Grant using Hierarchies

Case is setup: Private with Grant using Hierarchies

 

2 roles being used:

 

- PDR/DSR setup to control which users can access/manage the above entities.  They are set Read Only.

 

Any idea what I might be missing here that is causing the exception??

Hi:

 

   I have a VF section on Opportunity.  It has a button on the page to export the content as a pdf which is then attached to the opportunity.  The output is renderAs='pdf'.  Works fine with FF, Chrome....however, in IE 8 | 9 it complains that the file being opened when you click on the View File dialog is corrupt or broken.

 

   Any idea what is going on?

 

   Here is the code in the controller class that does the work:

 

    String attachmentName = 'outputPDF';

 

    Id oppId = apexpages.currentpage().getparameters().get('id');

    

    PageReference pdf = new PageReference('/apex/outputPDF?id='+oppId);

 

    pdf.getParameters().put('id',oppId);

     

    Blob pdfBlob = pdf.getContent();

 

    if (pdfName == null || pdfName.length() == 0)

       pdfName = attachmentName+'.pdf';

   

    Attachment saveAtch = new Attachment(ParentId = oppId, IsPrivate = false, ContentType = 'pdf', Name = pdfName, Body = pdfBlob);

 

    insert saveAtch;  

    

 

Note that the outputPDF VF page has renderAs='pdf' in the apex:page parameter.  Works in FF & Chrome, not in IE.

 

??

Hi:

 

   I'm using the Yahoo YUI toolkit simpleeditor component to capture via a pop-up window some remarks info.

 

   I have a button and associated inputTextArea field on the main page that holds the data field for the remark.  This is backed by a field with getter/setter methods in the controller class.

 

   In the pop-up page which uses YUI simpleeditor, the page renders fine and captures the rich text fine.  I attempt to post the contents that the editor collects using the following javascript function:

 

    function beforeTextSave()
    {
       var rem=myEditor.getEditorHTML();
       document.getElementById('{!$Component.remarksId}').value = rem;
    }

 

   I put an alert statement after the document to ensure it was capturing the data from simpleeditor OK and it was.

 

   The remarksId id refers to:

 

<div class="yui-skin-sam" style="display:none" id="editor" align="center" ><p />
    <apex:commandButton value="Save"  onclick="beforeTextSave();CloseWindow();"/>
 <apex:inputtextarea id="remarksId" rows="20" cols="75" value="{!remarks}" richText="true"/>

 

   What am I doing incorrectly here?  Should not the javascript be posting the updated editor data into the remarks field by virtue of me updating the component on the page by its ID.value?

 

thoughts??

 

I have a custom Visualforce page which extends from Opportunity.  In the page, I have a <apex:pageblockTable tag with an associated set of

columns within it.

 

I'm trying to set 2 of the 9 column headers in the headings row to a specific color....to no avail.

 

here is what I'm doing:

 

<style>

.list .headerStyle { background-color:#da1c00;text-align:center !important}

... clipped for brevity

</style>

 

...

...

 

<apex:pageblockTablevalue="{!Questions}" var="q" border="6" frame="box"  cellpadding="3" rules="cols" id="detailTable">

<apex:columnheaderValue="#" headerClass="grayClass">

<apex:outputFieldid="questionNo"  value="{!q.Question_Number__c}"/>

</apex:column>

 

<apex:columnheaderValue="Please answer the following questions by filling column D with numerical codes (1,2,3,4,5 or 6)" headerClass="headerStyle">

<apex:outputFieldvalue="{!q.Question_Text__c}"/>

</apex:column>

 

I also tried disabling the standardStylesheets as a parm tag to the <apex:page tag...didn't work either.

 

Any idea what I'm missing here?

 

thx.

Wendell

 

I have encountered a really strange problem that, despite trawling teh internets and the dev forums, I can't seem to solve. It is also very confusing, and seemingly has no pattern to it.

 

I have setup a Visualforce page that renders to PDF, and can be opened and printed from the Opportunity page.

 

However, one user seems to be unable to open the page from Internet Explorer 8 on her machine. When she tries to open the page, a window opens with the correct url, but before it loads the page, it cancels itself.

 

Her profile and role are the same as mine (admin), yet when I log on to SF on her machine, I can open the page in IE without any problem. To add to this, if she logs on in Firefox on her machine, or in Chrome on a Windows 7 machine, she can access the page ok.

 

Stranger still, if she logs on to IE9 on the W7 machine, she cannot access the page - it just repetedly rediects her back to the SF login screen. But if I log on to the same browser/machine, after one extra login, I can access the document.

 

Note that, whilst we have the same profile and role, I have the admin functions ticked in my user profile, whilst she does not.

 

Also note that I have tried 

cache="true"

and

standardStylesheets="false"

in the page descriptions, but neither solve the problem.

 

Can we find a solution, or is a browser change the only option?

 

Thanks in advance.

Hi

 

I have an apex:outputLink field inside a table cell.

I set the value to: www.mysite.com but when I press the link I get directed to https://c.na12.visual.force.com/apex/www.mysite.com

 

I can't understand why this is happening and how to fix it.

 

Any advise is appreciated.

 

Thanks

 

Oded

  • July 18, 2011
  • Like
  • 0