• code red
  • NEWBIE
  • 5 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 9
    Replies

Hi all,


I have created a beta managed package and some of my VF pages are not functioning properly when I install the package into a test org. My app has a very complex page navigation schema, using Custom Settings (for page nav) and Static Resources (for css and images). The pages work perfectly in the source org (in the actual managed package) but not so much in the test org.

 

Here is some markup from the page View Page Source where I detect a problem:

 

<div id="primary-navigation-wrapper">
<ul id="primary-navigation">
<div id="home-tab">


<li class="inactive"><a href="/apex/Splash"> </a></li>
</div>


<li class="inactive"><a href="/apex/ratinglist"><span>Compliance</span></a></li>
<li class="inactive"><a href="/apex/projectlist"><span>Projects</span></a></li>
<li class="inactive"><a href="/apex/aircraftlist"><span>Aircraft</span></a></li>
<li class="inactive"><a href="/apex/engineeringplanlist"><span>Engineering</span></a></li>
<li class="inactive"><a href="/apex/cataloglist"><span>Materials</span></a></li>
<li class="inactive"><a href="/apex/auditplanlist"><span>QMS</span></a></li>
<li class="inactive"><a href="/apex/issuelist"><span>Issues</span></a></li>
<li class="inactive"><a href="/apex/companylist"><span>Contacts</span></a></li>
<li class="inactive"><a href="/apex/reportlist"><span>Dashboard</span></a></li>
<div id="view-all-tabs">
<li class="inactive"><a href="/apex/AllObjects"> </a></li>
</div>
</ul>
</div>

 

I have underlined and highlighted the suspect markup. The state of our 'splash' page should be 'active', but is returning as 'inactive'. With the page state 'inactive' some of the page links are invisible (though the page link function works), and the color of all links and action/command functions are light gray or invisible as taken from our various css/Static Resource files. All of my 'related' lists are intact and functioning.

 

When I hover over a VF page link (the image is missing) and nav to that page, the related reference in the above markup should be 'active', but it is not. None of my linked page references can be made active. In the source org upon selecting a related page, the markup returns 'active'.

 

I have checked all package elements and everything is included and passing to the installed package in the test org, but I don't know where the state of a page view would be set by any of our code; as noted, the pages work fine in the managed package.

 

When I deploy all the source code from Eclipse/Force.com IDE, everything works perfectly.

 

Would anyone have a suggestion or similar experience on this problem? Thanks in advance!

 

Regards...

 

 

Hi all;

 

I have a beta managed package and have installed it in a new dev org but there is a problem; some of my Static Resources don't seem to be loading.

 

On my home page I have several VF page links. Those links have an image taken from Static Resources; the images are not loading but the link action is working. Also, some standard feature links (e.g., Edit, Delete, etc.) are gray instead of the color called in the CSS, and when hovered over they go invisible.

 

All of my pages and objects are Custom (we are not using any standard objects).

 

I've looked at the Static Resource files and they are present.

 

The VF page CSS file attributes are:

MIME type; text/css

Cache Control; Public

 

The images file attributes are:

MIME type; application/zip

Cache Control; Public

 

Thank you in advance for any suggestions.

Hi all;

 

I am having problems uploading a package; beta at this point, and ultimately to released. All of my code has some unit test coverage, and overall it sits at 87%. I have done ‘run all tests’ in the Apex Class, and have no (0) errors. I have run the Apex Test Execution under Settings/App Setup/Develop/Apex Test Execution with no (0) fails. I should note that I have had one class fail on and off. Sometimes I run all tests and have no fails, and other times I have one class fail. I don't know why the running of tests has different results. But at the moment I have no fails.

 

When I attempt an upload the upload fails, and the system note states; Average test coverage across all Apex Classes and Triggers is 70%, at least 75% test coverage is required.

 

But I’m at 87% based on the ‘run all tests’?

 

Has anyone encountered similar problems, and if so, how did you resolve them?

 

Thanks in advance.

Hi all;

 

I have a list type Custom Setting with one Custom Field which is used to populate a selectList on a VF page.

 

  • CS API Name; LaborType__c
  • Custom Field Label; Rate, API Name; Rate__c, Data Type; Currency
  • In the CS Data Details (the managed list); Name (e.g.) Mechanic, Rate (e.g.) $90

 

On the VF page supported by a custom object with Labor Type and Rate fields, and page controller with a selectList, the user selects a Labor Type (e.g.) Mechanic (the Name from the CS Custom Field list), and the related labor rate should populate the Rate field automatically.

 

Though I have read all the SF documentation and every post on the subject here, I cannot find an example of bringing the values of both of the CS Custom Fields to a VF page based on the selection of ONE of those values.

 

Eventually the labor rate (stored value) will be included in a formula; e.g., number of hours applied x labor rate, etc.

 

Thanks in advance for any suggestions or examples of how this might be done.

 

Hi all;

 

I have a custom VF page with a date field, which uses the standard VF calendar widget. Every time I open the form in Edit mode the saved date is wiped out?

 

The field value is saved in a custom object, it is not a required field, and there are no triggers or validations affecting it. (I have this same problem in some other pages too, all with the same field attributes.)

 

Does anyone also have this problem, and are there solutions?

 

Thanks in advance.

Hi all;

 

I have successfully incorporated numerous GV in my Visualforce pages. One type that I am struggling with is the ‘interactive’ types; example: the GV ‘Full Dashboard’.

 

In that example the JSON data is hard coded. What I want to do is pull data from a SOQL source. There are examples of this in the Code Share project for Google Visualizations, but for some reason I cannot get this to work for the Full Dashboard.

 

For all VF pages I am using Visualforce Components. Here is one, as taken from the Code Share for Bar Charts add in; it uses a jsondata data source: var data = new google.visualization.DataTable( eval( '({!jsondata})' ) )

 

<apex:component >

    <apex:attribute name="jsondata" description="This is the chart data" type="string" required="true" />

    <apex:attribute name="title" description="This is the chart title" type="string" required="true" />

    <apex:attribute name="enableTooltip" description="If set to true, tooltips are shown when the user clicks on a data point." type="Boolean"/>   

    <apex:attribute name="height" description="This is the chart height" type="integer" default="400" />

    <apex:attribute name="width" description="This is the chart width" type="integer" default="500" />

    <apex:attribute name="is3D" description="This determines whether or not the chart is 3D."  type="boolean" default="true"/>

    <apex:attribute name="legend" description="This is the legend location" type="string" default="right" />

    <apex:attribute name="showCategories" description="If true, will show category labels. If false, will not." type="Boolean"/>   

    <apex:attribute name="colors" description="This is the list of colors for the columns." type="string[]"/>

    <apex:attribute name="borderColor" description="This is the color of the border around chart elements." type="string" default="white" />

    <apex:attribute name="focusBorderColor" description="This is the color of the border around chart elements that are in focus." type="string" default="red" />

 

    <apex:outputPanel id="chart_div">

        <script type="text/javascript" src="https://www.google.com/jsapi"></script>

        <script type="text/javascript">

  google.load("visualization", "1", {packages: ["Barchart" ]});

  google.setOnLoadCallback(drawLineChart);

 

  function drawLineChart() {

  var data = new google.visualization.DataTable( eval( '({!jsondata})' ) );

 

  var chart = new google.visualization.BarChart(document.getElementById('{!$Component.chart_div}'));

        chart.draw(data, {width: {!width}, height: {!height}, 

        legend: '{!legend}',  // should be passed in via attribute

        smoothLine: true,  // should be passed in via attribute

        title: '{!title}',       

        is3D : {!is3D},

        colors : [{!colors}],      

        borderColor : '{!borderColor}',

        focusBorderColor : '{!focusBorderColor}'

        });

 

   /*

   google.visualization.events.addListener(table, 'select', function() {

    var row = chart.getSelection()[0].row;

    // alert('You selected ' + data.getValue(row, 0));

    window.location.href = '/'+data.getValue(row, 0);

   });*/

 }

 

</script>

    </apex:outputPanel>

</apex:component>

 

Here is the html for the Full Dashboard (from Google Code Playground), for which I need to supply the SFDC data source from custom objects:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>
      Google Visualization API Sample
    </title>
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load('visualization', '1.1', {packages: ['controls']});
    </script>
    <script type="text/javascript">
      function drawVisualization() {
        // Prepare the data
        var data = google.visualization.arrayToDataTable([
          ['Name', 'Gender', 'Age', 'Donuts eaten'],
          ['Michael' , 'Male', 12, 5],
          ['Elisa', 'Female', 20, 7],
          ['Robert', 'Male', 7, 3],
          ['John', 'Male', 54, 2],
          ['Jessica', 'Female', 22, 6],
          ['Aaron', 'Male', 3, 1],
          ['Margareth', 'Female', 42, 8],
          ['Miranda', 'Female', 33, 6]
        ]);  
        
        // Define a slider control for the Age column.
        var slider = new google.visualization.ControlWrapper({
          'controlType': 'NumberRangeFilter',
          'containerId': 'control1',
          'options': {
            'filterColumnLabel': 'Age',
          'ui': {'labelStacking': 'vertical'}
          }
        });
      
        // Define a category picker control for the Gender column
        var categoryPicker = new google.visualization.ControlWrapper({
          'controlType': 'CategoryFilter',
          'containerId': 'control2',
          'options': {
            'filterColumnLabel': 'Gender',
            'ui': {
            'labelStacking': 'vertical',
              'allowTyping': false,
              'allowMultiple': false
            }
          }
        });
      
        // Define a Pie chart
        var pie = new google.visualization.ChartWrapper({
          'chartType': 'PieChart',
          'containerId': 'chart1',
          'options': {
            'width': 300,
            'height': 300,
            'legend': 'none',
            'title': 'Donuts eaten per person',
            'chartArea': {'left': 15, 'top': 15, 'right': 0, 'bottom': 0},
            'pieSliceText': 'label'
          },
          // Instruct the piechart to use colums 0 (Name) and 3 (Donuts Eaten)
          // from the 'data' DataTable.
          'view': {'columns': [0, 3]}
        });
      
        // Define a table
        var table = new google.visualization.ChartWrapper({
          'chartType': 'Table',
          'containerId': 'chart2',
          'options': {
            'width': '300px'
          }
        });
      
        // Create a dashboard
        new google.visualization.Dashboard(document.getElementById('dashboard')).
            // Establish bindings, declaring the both the slider and the category
            // picker will drive both charts.
            bind([slider, categoryPicker], [pie, table]).
            // Draw the entire dashboard.
            draw(data);
      }
      

      google.setOnLoadCallback(drawVisualization);
    </script>
  </head>
  <body style="font-family: Arial;border: 0 none;">
    <div id="dashboard">
      <table>
        <tr style='vertical-align: top'>
          <td style='width: 300px; font-size: 0.9em;'>
            <div id="control1"></div>
            <div id="control2"></div>
            <div id="control3"></div>
          </td>
          <td style='width: 600px'>
            <div style="float: left;" id="chart1"></div>
            <div style="float: left;" id="chart2"></div>
            <div style="float: left;" id="chart3"></div>
          </td>
        </tr>
      </table>
    </div>
  </body>
</html>

 

I have been successful at implementing this script within a VF page with hard coded data, but I have tried every variation of the ‘var data’ markup but no data is passed to the GV. I have searched endlessly in this board, and Google searches, but have found no examples of anyone attempting to use this particular GV in Visualforce.

 

In the ‘var data = google.visualization.arrayToDataTable’ markup I need something like ‘var data = new google.visualization.DataTable( eval( '({!jsondata})' ) );’ but cannot figure out the correct syntax.

 

Thank you in advance for any help or suggestions.

Hi,

 

We need to set the source of an iframe using a text field on a VF page on page load. The text field on the parent page contains the name of another VF page to load in the iframe.

 

This works (full URL):

<iframe width="100%" height="500" frameborder="0" scrolling="true" marginheight="0" marginwidth="0" src="https://c.na7.visual.force.com/apex/aaobarchartplain" ></iframe>

 

This does not (where Dashboard_Report__c is the custom object, and Page_Name__c is the name of the field containing the name of the VF page we want to load in the iframe; page name example is rmbarchart):

 <iframe width="100%" height="500" frameborder="0" scrolling="true" marginheight="0" marginwidth="0" src="Dashboard_Report__c. Page_Name__c"></iframe>

 

On the latter, an error is thrown; “The name 'c.Page_Name' can only contain alphanumeric characters, must begin with a letter, and must be unique.”

 

This also throws an error:

 <iframe width="100%" height="500" frameborder="0" scrolling="true" marginheight="0" marginwidth="0" src="Page_Name">

Error; “Page Page_Name does not exist”

 

Any help or suggestions is appreciated.

Hi all,

 

I am tyring to run a page level function from a commandbutton click.

 

The function is embedded in a VF page, and is intended to open a dialog box to edit a chart. The chart is taken from Google Visualizations; Chart Editor. You can find this chart at the Google Visualization site; Google Visualization API Reference.

 

The idea is that there is a parent chart (VF page in my case), and upon clicking on 'Edit Me', a dialog opens as an instance of that chart (VF page),  and its data source. Saving the modified chart places it in a Div on the parent page.

 

I've been able to replicate a VF page using the source data provided in the example. I have not been successful in pointing to a JSON data source (DataTable) (but I'll save that for another post), nor have I been successful in launching the dialog instance of the parent page.

 

I have loaded the VF codeshare for Google Visualizations, but Chart Editor is not included in that effort.

 

I am using VF Components to drive pages in all other VF pages, which do render the GV, but not this one. With the Chart Editor page I have taken a different approach, in that rather than use a VF Component to render the page, I have written all the code in the page constructs. The Function to instansiate the dialog is also included (loadEditor()).

 

Here's the code for the page that renders the GV chart, and from which I would like to launch the Function to create an instance of it:

<apex:page id="page" standardcontroller="Work_Order__c" extensions="PageExtension,WorkOrderBarChartExtension" showHeader="false" sidebar="false" standardStylesheets="false">
 <apex:composition template="{!$Page.SiteTemplate}">
    <apex:define name="body">
  <apex:form id="form">
    <apex:pageBlock id="page_block" title="Work Order Data">
        <apex:pageBlockButtons >

        </apex:pageBlockButtons>
   </apex:pageBlock>
    <title>
      Google Visualization API Sample
    </title>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load('visualization', '1.0', {packages: ['charteditor']});
    </script>
    <script type="text/javascript">
 google.setOnLoadCallback(drawChartEditor);
var chartEditor = null;
var wrap = null;
var chartEditorDiv = null;

  // Populates the chart div on startup and initiates global vars. Called on page load.
  function drawChartEditor(){
    // Initialize Chart editor handle
    chartEd = new google.visualization.ChartEditor();
    google.visualization.events.addListener(chartEd, 'ok', saveChart);
    chartEditorDiv = document.getElementById('chartEditorDiv');

    // Add the chart to the page
    wrap = new google.visualization.ChartWrapper({
       'chartType':'LineChart',
       'dataSourceUrl':'http://spreadsheets.google.com/tq?key=pCQbetd-CptGXxxQIG7VFIQ&pub=1',
       'query':'SELECT A,D WHERE D > 100 ORDER BY D',
       'options': {'title':'Population Density (people/km^2)', 'legend':'none'}
       });
    wrap.draw(chartEditorDiv);
  }

  // User clicked 'ok' to save chart
  function saveChart(){
    chartEd.getChartWrapper().draw(chartEditorDiv);
  }

  // Onclick handler, opens the editor
  function loadEditor() {
    chartEd.openDialog(wrap, {});
  }
</script>
  </head>
  <body>
<div id="chartEditorDiv" style="width:600px; height:400px;">
</div>
  </body>
  </apex:form>
   </apex:define>
  </apex:composition>
</apex:page>
               

(Note; in the case of this VF page, there is nothing in the Extension that constructs the page relative to my question.)

 

As mentioned; have been able to create the page with the GV example of a chart. I have been unsuccessful in launching the Function to open the dialog, and have tried to put the 'editor' in the page's extension (WorkOrderBarChartExtension), but unsuccessfully. I've not seen an example of putting page constructs in an Apex Class.

 

Maybe it is not possible to run a function at the VF page level? If not, how do I write a VF page construct into a VF Component or Apex Class?

 

I can post more code if needed. Thank you in advance for any suggestions.

Hi all;

 

I have a beta managed package and have installed it in a new dev org but there is a problem; some of my Static Resources don't seem to be loading.

 

On my home page I have several VF page links. Those links have an image taken from Static Resources; the images are not loading but the link action is working. Also, some standard feature links (e.g., Edit, Delete, etc.) are gray instead of the color called in the CSS, and when hovered over they go invisible.

 

All of my pages and objects are Custom (we are not using any standard objects).

 

I've looked at the Static Resource files and they are present.

 

The VF page CSS file attributes are:

MIME type; text/css

Cache Control; Public

 

The images file attributes are:

MIME type; application/zip

Cache Control; Public

 

Thank you in advance for any suggestions.

Hi all;

 

I am having problems uploading a package; beta at this point, and ultimately to released. All of my code has some unit test coverage, and overall it sits at 87%. I have done ‘run all tests’ in the Apex Class, and have no (0) errors. I have run the Apex Test Execution under Settings/App Setup/Develop/Apex Test Execution with no (0) fails. I should note that I have had one class fail on and off. Sometimes I run all tests and have no fails, and other times I have one class fail. I don't know why the running of tests has different results. But at the moment I have no fails.

 

When I attempt an upload the upload fails, and the system note states; Average test coverage across all Apex Classes and Triggers is 70%, at least 75% test coverage is required.

 

But I’m at 87% based on the ‘run all tests’?

 

Has anyone encountered similar problems, and if so, how did you resolve them?

 

Thanks in advance.

Hi all;

 

I have a list type Custom Setting with one Custom Field which is used to populate a selectList on a VF page.

 

  • CS API Name; LaborType__c
  • Custom Field Label; Rate, API Name; Rate__c, Data Type; Currency
  • In the CS Data Details (the managed list); Name (e.g.) Mechanic, Rate (e.g.) $90

 

On the VF page supported by a custom object with Labor Type and Rate fields, and page controller with a selectList, the user selects a Labor Type (e.g.) Mechanic (the Name from the CS Custom Field list), and the related labor rate should populate the Rate field automatically.

 

Though I have read all the SF documentation and every post on the subject here, I cannot find an example of bringing the values of both of the CS Custom Fields to a VF page based on the selection of ONE of those values.

 

Eventually the labor rate (stored value) will be included in a formula; e.g., number of hours applied x labor rate, etc.

 

Thanks in advance for any suggestions or examples of how this might be done.

 

Hi all;

 

I have a custom VF page with a date field, which uses the standard VF calendar widget. Every time I open the form in Edit mode the saved date is wiped out?

 

The field value is saved in a custom object, it is not a required field, and there are no triggers or validations affecting it. (I have this same problem in some other pages too, all with the same field attributes.)

 

Does anyone also have this problem, and are there solutions?

 

Thanks in advance.

Hi,

 

We need to set the source of an iframe using a text field on a VF page on page load. The text field on the parent page contains the name of another VF page to load in the iframe.

 

This works (full URL):

<iframe width="100%" height="500" frameborder="0" scrolling="true" marginheight="0" marginwidth="0" src="https://c.na7.visual.force.com/apex/aaobarchartplain" ></iframe>

 

This does not (where Dashboard_Report__c is the custom object, and Page_Name__c is the name of the field containing the name of the VF page we want to load in the iframe; page name example is rmbarchart):

 <iframe width="100%" height="500" frameborder="0" scrolling="true" marginheight="0" marginwidth="0" src="Dashboard_Report__c. Page_Name__c"></iframe>

 

On the latter, an error is thrown; “The name 'c.Page_Name' can only contain alphanumeric characters, must begin with a letter, and must be unique.”

 

This also throws an error:

 <iframe width="100%" height="500" frameborder="0" scrolling="true" marginheight="0" marginwidth="0" src="Page_Name">

Error; “Page Page_Name does not exist”

 

Any help or suggestions is appreciated.

Hi all,

 

I am tyring to run a page level function from a commandbutton click.

 

The function is embedded in a VF page, and is intended to open a dialog box to edit a chart. The chart is taken from Google Visualizations; Chart Editor. You can find this chart at the Google Visualization site; Google Visualization API Reference.

 

The idea is that there is a parent chart (VF page in my case), and upon clicking on 'Edit Me', a dialog opens as an instance of that chart (VF page),  and its data source. Saving the modified chart places it in a Div on the parent page.

 

I've been able to replicate a VF page using the source data provided in the example. I have not been successful in pointing to a JSON data source (DataTable) (but I'll save that for another post), nor have I been successful in launching the dialog instance of the parent page.

 

I have loaded the VF codeshare for Google Visualizations, but Chart Editor is not included in that effort.

 

I am using VF Components to drive pages in all other VF pages, which do render the GV, but not this one. With the Chart Editor page I have taken a different approach, in that rather than use a VF Component to render the page, I have written all the code in the page constructs. The Function to instansiate the dialog is also included (loadEditor()).

 

Here's the code for the page that renders the GV chart, and from which I would like to launch the Function to create an instance of it:

<apex:page id="page" standardcontroller="Work_Order__c" extensions="PageExtension,WorkOrderBarChartExtension" showHeader="false" sidebar="false" standardStylesheets="false">
 <apex:composition template="{!$Page.SiteTemplate}">
    <apex:define name="body">
  <apex:form id="form">
    <apex:pageBlock id="page_block" title="Work Order Data">
        <apex:pageBlockButtons >

        </apex:pageBlockButtons>
   </apex:pageBlock>
    <title>
      Google Visualization API Sample
    </title>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load('visualization', '1.0', {packages: ['charteditor']});
    </script>
    <script type="text/javascript">
 google.setOnLoadCallback(drawChartEditor);
var chartEditor = null;
var wrap = null;
var chartEditorDiv = null;

  // Populates the chart div on startup and initiates global vars. Called on page load.
  function drawChartEditor(){
    // Initialize Chart editor handle
    chartEd = new google.visualization.ChartEditor();
    google.visualization.events.addListener(chartEd, 'ok', saveChart);
    chartEditorDiv = document.getElementById('chartEditorDiv');

    // Add the chart to the page
    wrap = new google.visualization.ChartWrapper({
       'chartType':'LineChart',
       'dataSourceUrl':'http://spreadsheets.google.com/tq?key=pCQbetd-CptGXxxQIG7VFIQ&pub=1',
       'query':'SELECT A,D WHERE D > 100 ORDER BY D',
       'options': {'title':'Population Density (people/km^2)', 'legend':'none'}
       });
    wrap.draw(chartEditorDiv);
  }

  // User clicked 'ok' to save chart
  function saveChart(){
    chartEd.getChartWrapper().draw(chartEditorDiv);
  }

  // Onclick handler, opens the editor
  function loadEditor() {
    chartEd.openDialog(wrap, {});
  }
</script>
  </head>
  <body>
<div id="chartEditorDiv" style="width:600px; height:400px;">
</div>
  </body>
  </apex:form>
   </apex:define>
  </apex:composition>
</apex:page>
               

(Note; in the case of this VF page, there is nothing in the Extension that constructs the page relative to my question.)

 

As mentioned; have been able to create the page with the GV example of a chart. I have been unsuccessful in launching the Function to open the dialog, and have tried to put the 'editor' in the page's extension (WorkOrderBarChartExtension), but unsuccessfully. I've not seen an example of putting page constructs in an Apex Class.

 

Maybe it is not possible to run a function at the VF page level? If not, how do I write a VF page construct into a VF Component or Apex Class?

 

I can post more code if needed. Thank you in advance for any suggestions.

I'm trying to show a couple of comment boxes using inputField components linked to long text area fields (32,000).
 
Code:
<apex:pageBlockSection title="Other Details" columns="1">
 <apex:inputField value="{!claimNotification.Notifier_Relationship__c}"/>
 <apex:inputField value="{!claimNotification.Notifier_Why_Contact__c}"/>
</apex:pageBlockSection>   

 
I'm showing them in a 1 column pageBlockSection but the rendered textbox is very narrow - about 25% of the width of the section.
 
How do I make the textbox (inputField) wider?