• AMS
  • NEWBIE
  • 0 Points
  • Member since 2008

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

I have a javascript function (using Protovis) that draws a dynamic pie chart in my Visualforce page. The pie chart is contained within an outputPanel, and a button at the top of the page rerenders that outputPanel. The javascript works perfectly the first time the page is loaded. However, after the button is pressed and the section rerenders, the javascript never executes a second time -- the pie chart disappears and the alert on line 16 does not fire. How can I make sure my function executes after the rerender event?

 

 

<apex:page controller="devTracking" > <script type="text/javascript" src="{!URLFOR($Resource.Protovis, 'protovis-r3.1.js')}"></script> <apex:form > <apex:commandButton id="goButton" value="Go" action="{!start}" rerender="container"></apex:commandButton> </apex:form> <apex:outputPanel id="container"> <apex:pageBlock title="Sample Protovis Graph"> <script type="text/javascript+protovis"> function renderMe() { alert('debug #1'); var data = pv.range(10).map(Math.random).sort(pv.reverseOrder), w = 400, h = 400, r = w / 2, a = pv.Scale.linear(0, pv.sum(data)).range(0, 2 * Math.PI); var vis = new pv.Panel() .width(w) .height(h); vis.add(pv.Wedge) .data(data) .bottom(w / 2) .left(w / 2) .outerRadius(r) .angle(a) .title(function(d) d) .add(pv.Wedge) // invisible wedge to offset label .visible(function(d) d > .15) .innerRadius(2 * r / 3) .outerRadius(r) .fillStyle(null) .anchor("center").add(pv.Label) .textAngle(0) .text(function(d) d.toFixed(2)); vis.render(); } renderMe(); </script> </apex:pageBlock> </apex:outputPanel> </apex:page>

 

 

 

  • December 27, 2010
  • Like
  • 0

Anyone willing to share code samples for either of the following?

 

  • Google Visualization component that refreshes dynamically as part of an outputPanel
  • Multiple Google Viz components linked together on the same VF page

I'm just getting started with the Google Viz project from the Code Share and would love to avoid reinventing the wheel if other people have done these use cases already.
  • September 30, 2009
  • Like
  • 0

I'm working on extending the Sorting Tables example from the wiki: http://wiki.developerforce.com/index.php/Sorting_Tables

 

I'd like the user to be able to enter some filter criteria and then see a sortable table of the results. One of the filter criteria is a checkbox for "Include Details." If this box is checked, the user should get a sortable table; if not, just some summary data. 

 

The problem that I'm running into is that adding a rendered="{!includeDetails}" attribute to the details pageBlock breaks my sorting action --- clicking on a column heading no longer does anything. Without the rendered attribute, both doFilter and doSort work correctly; with the rendered attribute, doFilter works and outputs a table, but it isn't sortable.

 

 

<apex:page controller="forecastClass" tabstyle="Opportunity" sidebar="false"> <apex:form > <apex:pageBlock title="Filter Criteria"> <table cellpadding = "4" cellspacing = "4"> <tr> <td><label><b>Site: </b></label></td> <td><label><b>Start Date: </b></label></td> <td><label><b>End Date: </b></label></td> <td><label><b>Include details? </b></label></td> <td></td> </tr> <tr> <td><apex:inputField value="{!filterOp.Site__c}"/></td> <td><apex:inputField id="StartDate" value="{!filterOp.CloseDate}" /></td> <td><apex:inputField id="EndDate" value="{!filterOp.Confirmation_Date__c}" /></td> <td align="center"><apex:inputField id="IncDetails" value="{!filterOp.Anonymous_gift__c}" /></td> <td><apex:commandButton value="Go" action="{!doFilter}" rerender="container"></apex:commandButton></td> </tr> </table> </apex:pageBlock> </apex:form> <apex:outputPanel id="container"> <apex:pageBlock id="opDetails" title="Opportunity Details" rendered="{!includeDetails}"> <!-- remove rendered attrib for sorting --> <apex:form > <apex:pageBlockTable value="{!opps}" var="o" id="table"> <apex:column > <apex:facet name="header"> <apex:commandLink value="{!$ObjectType.Opportunity.Fields.Name.Label}" action="{!doSort}" rerender="table"> <apex:param name="sortField" value="Name" assignTo="{!sortField}"/> </apex:commandLink> </apex:facet> <apex:outputLink value="/{!o.id}">{!o.name}</apex:outputLink> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="{!$ObjectType.Opportunity.Fields.StageName.Label}" action="{!doSort}" rerender="table"> <apex:param name="sortField" value="StageName" assignTo="{!sortField}"/> </apex:commandLink> </apex:facet> <apex:outputField value="{!o.StageName}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="%" action="{!doSort}" rerender="table"> <apex:param name="sortField" value="Probability" assignTo="{!sortField}"/> </apex:commandLink> </apex:facet> <apex:outputField value="{!o.Probability}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="{!$ObjectType.Opportunity.Fields.CloseDate.Label}" action="{!doSort}" rerender="table"> <apex:param name="sortField" value="CloseDate" assignTo="{!sortField}"/> </apex:commandLink> </apex:facet> <apex:outputField value="{!o.CloseDate}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="{!$ObjectType.Opportunity.Fields.Amount.Label}" action="{!doSort}" rerender="table"> <apex:param name="sortField" value="Amount" assignTo="{!sortField}"/> </apex:commandLink> </apex:facet> <apex:outputField value="{!o.Amount}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="Revenue" action="{!doSort}" rerender="table"> <apex:param name="sortField" value="Time_Restriction__c" assignTo="{!sortField}"/> </apex:commandLink> </apex:facet> <apex:outputField value="{!o.Time_Restriction__c}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="Type" action="{!doSort}" rerender="table"> <apex:param name="sortField" value="Type" assignTo="{!sortField}"/> </apex:commandLink> </apex:facet> <apex:outputField value="{!o.Type}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="Owner" action="{!doSort}" rerender="table"> <apex:param name="sortField" value="OwnerId" assignTo="{!sortField}"/> </apex:commandLink> </apex:facet> <apex:outputField value="{!o.OwnerId}"/> </apex:column> </apex:pageBlockTable> </apex:form> </apex:pageBlock> <!-- opDetails --> </apex:outputPanel> <!-- container --> </apex:page>

 

 

  • September 30, 2009
  • Like
  • 0
I'm trying to implement an "upcoming birthdays" report as described here:

http://blogs.salesforce.com/analytics/2007/12/if-youre-like-m.html

except that

1. the images in that blog post are broken, and
2. i don't want to install the entire appexchange package (9 components) when all I really need to see is the formula field definition for "Next Birthday."

Anyone have this package installed already and willing to share the formula? Thanks!

Aaron
  • February 11, 2008
  • Like
  • 0

I have this visualforce page added as a component in a Dashboard.The page just has a simple text in it.

But everytime I hit the refresh button on the browser, this page component disappears, although all other components on the same Dashboard(like charts,table etc) are visible after the refresh. I need to fix this urgently, any help would be great.

Thanks. 

  • February 02, 2010
  • Like
  • 0

I'm working on extending the Sorting Tables example from the wiki: http://wiki.developerforce.com/index.php/Sorting_Tables

 

I'd like the user to be able to enter some filter criteria and then see a sortable table of the results. One of the filter criteria is a checkbox for "Include Details." If this box is checked, the user should get a sortable table; if not, just some summary data. 

 

The problem that I'm running into is that adding a rendered="{!includeDetails}" attribute to the details pageBlock breaks my sorting action --- clicking on a column heading no longer does anything. Without the rendered attribute, both doFilter and doSort work correctly; with the rendered attribute, doFilter works and outputs a table, but it isn't sortable.

 

 

<apex:page controller="forecastClass" tabstyle="Opportunity" sidebar="false"> <apex:form > <apex:pageBlock title="Filter Criteria"> <table cellpadding = "4" cellspacing = "4"> <tr> <td><label><b>Site: </b></label></td> <td><label><b>Start Date: </b></label></td> <td><label><b>End Date: </b></label></td> <td><label><b>Include details? </b></label></td> <td></td> </tr> <tr> <td><apex:inputField value="{!filterOp.Site__c}"/></td> <td><apex:inputField id="StartDate" value="{!filterOp.CloseDate}" /></td> <td><apex:inputField id="EndDate" value="{!filterOp.Confirmation_Date__c}" /></td> <td align="center"><apex:inputField id="IncDetails" value="{!filterOp.Anonymous_gift__c}" /></td> <td><apex:commandButton value="Go" action="{!doFilter}" rerender="container"></apex:commandButton></td> </tr> </table> </apex:pageBlock> </apex:form> <apex:outputPanel id="container"> <apex:pageBlock id="opDetails" title="Opportunity Details" rendered="{!includeDetails}"> <!-- remove rendered attrib for sorting --> <apex:form > <apex:pageBlockTable value="{!opps}" var="o" id="table"> <apex:column > <apex:facet name="header"> <apex:commandLink value="{!$ObjectType.Opportunity.Fields.Name.Label}" action="{!doSort}" rerender="table"> <apex:param name="sortField" value="Name" assignTo="{!sortField}"/> </apex:commandLink> </apex:facet> <apex:outputLink value="/{!o.id}">{!o.name}</apex:outputLink> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="{!$ObjectType.Opportunity.Fields.StageName.Label}" action="{!doSort}" rerender="table"> <apex:param name="sortField" value="StageName" assignTo="{!sortField}"/> </apex:commandLink> </apex:facet> <apex:outputField value="{!o.StageName}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="%" action="{!doSort}" rerender="table"> <apex:param name="sortField" value="Probability" assignTo="{!sortField}"/> </apex:commandLink> </apex:facet> <apex:outputField value="{!o.Probability}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="{!$ObjectType.Opportunity.Fields.CloseDate.Label}" action="{!doSort}" rerender="table"> <apex:param name="sortField" value="CloseDate" assignTo="{!sortField}"/> </apex:commandLink> </apex:facet> <apex:outputField value="{!o.CloseDate}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="{!$ObjectType.Opportunity.Fields.Amount.Label}" action="{!doSort}" rerender="table"> <apex:param name="sortField" value="Amount" assignTo="{!sortField}"/> </apex:commandLink> </apex:facet> <apex:outputField value="{!o.Amount}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="Revenue" action="{!doSort}" rerender="table"> <apex:param name="sortField" value="Time_Restriction__c" assignTo="{!sortField}"/> </apex:commandLink> </apex:facet> <apex:outputField value="{!o.Time_Restriction__c}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="Type" action="{!doSort}" rerender="table"> <apex:param name="sortField" value="Type" assignTo="{!sortField}"/> </apex:commandLink> </apex:facet> <apex:outputField value="{!o.Type}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="Owner" action="{!doSort}" rerender="table"> <apex:param name="sortField" value="OwnerId" assignTo="{!sortField}"/> </apex:commandLink> </apex:facet> <apex:outputField value="{!o.OwnerId}"/> </apex:column> </apex:pageBlockTable> </apex:form> </apex:pageBlock> <!-- opDetails --> </apex:outputPanel> <!-- container --> </apex:page>

 

 

  • September 30, 2009
  • Like
  • 0

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.

 

 

 

 

Error 

 

Message Edited by dchasman on 06-08-2009 01:00 PM