• J&A
  • NEWBIE
  • 30 Points
  • Member since 2011

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

Hi all,

 

I'm having a problem with a visualforce page that I've developed. The initial load either times out or it takes over 30 secs. After the page has loaded though, it takes less than a sec to reload the same page. My first thought was to check the view state size of the page, which is about 20K. I can optimize the view state size of the page later if needed, but at 20K, I didn't think this could be the culprit. 

 

I'd post my VF page/Apex controller, but they are very long so I'll try to walk through the code:

Controller

- Within its constructor, I perform 5 total queries: one SOQL to get some custom fields from the current user, one SOQL to get the profile name of the current user, one SOSL to get all the users within a certain criteria (I use the LIKE operator in it), one SOQL to search events and the last one to get tasks.

- I really don't like the fact that I'm running 5 queries within the constructor. But I wasn't sure how I could refractor them to help the load issue.

 

VF page

- There are three main components: one block that allows users to use a custom search, one block that shows their events and the last block that shows their tasks.

- One thing that I do within the page is to use the data from the controller extensively. For example:

<apex:column width="20%" styleClass="custTableClass">
<apex:facet name="header">
        <apex:outputText value="Description"/>
        </apex:facet>
        <div id="desc{!e.evt.Id}_{!e.evt.ActivityDate}">
                <apex:outputField value="{!e.evt.Description}"/>
        </div></apex:column>

 I use jquery to apply row coloring and such on a pageBlockTable, so I wrap apex components within a div tag so that I pass the event's id and date as part of the id attribute. I use this technique extensively within my page, so I didn't know if this could have any impact on page load.

 

Let me know if I need to provide any further info. And sorry for the long post.

 

Thanks!

 

  • November 08, 2011
  • Like
  • 0

Hi all,

 

I'm having a problem with a visualforce page that I've developed. The initial load either times out or it takes over 30 secs. After the page has loaded though, it takes less than a sec to reload the same page. My first thought was to check the view state size of the page, which is about 20K. I can optimize the view state size of the page later if needed, but at 20K, I didn't think this could be the culprit. 

 

I'd post my VF page/Apex controller, but they are very long so I'll try to walk through the code:

Controller

- Within its constructor, I perform 5 total queries: one SOQL to get some custom fields from the current user, one SOQL to get the profile name of the current user, one SOSL to get all the users within a certain criteria (I use the LIKE operator in it), one SOQL to search events and the last one to get tasks.

- I really don't like the fact that I'm running 5 queries within the constructor. But I wasn't sure how I could refractor them to help the load issue.

 

VF page

- There are three main components: one block that allows users to use a custom search, one block that shows their events and the last block that shows their tasks.

- One thing that I do within the page is to use the data from the controller extensively. For example:

<apex:column width="20%" styleClass="custTableClass">
<apex:facet name="header">
        <apex:outputText value="Description"/>
        </apex:facet>
        <div id="desc{!e.evt.Id}_{!e.evt.ActivityDate}">
                <apex:outputField value="{!e.evt.Description}"/>
        </div></apex:column>

 I use jquery to apply row coloring and such on a pageBlockTable, so I wrap apex components within a div tag so that I pass the event's id and date as part of the id attribute. I use this technique extensively within my page, so I didn't know if this could have any impact on page load.

 

Let me know if I need to provide any further info. And sorry for the long post.

 

Thanks!

 

  • November 08, 2011
  • Like
  • 0

Hi

 

I need to add a In Line VF page with Google's V3 Maps API. I already have a s-control with v2 api but it requires a Google Map API Key.

 

Can someone please provide an example of Inline VF page with Google's V3 Maps API, so that I can show Google map for a address and include this page on a detail page layout.

 

 

Thanks

My Product has REST base webservices have data from different sources.

 

How can I code APEX to return results based on calling my REST services and returning the data and then show it in VisualSource?

 

Thanks