• GaryA
  • NEWBIE
  • 4 Points
  • Member since 2011
  • Sr. Developer
  • Acumen Solutions, Inc.

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

I'm trying to set the Interval attribute of the ActionPoller component from a property in the underlying controller.  When I check the generated HTML, I see it defaults to 60,000ms, which is the default value if you don't specify a value for Interval.  If I hard code a value, say 5 secs, in the ActionPoller, then I see the correct 5,000ms in the generated HTML.  Here is the VF and Apex sample that demonstrates the faulty behavior:

 

<apex:page controller="PollerTestController" > 
<apex:form > 
    <apex:actionpoller interval="{!RefreshInterval}" action="{!testAction}" rerender="counter" /> 
    <apex:outputtext value="{!Count}" id="counter" />
    <br/>
    Interval: <apex:outputtext value="{!RefreshInterval}" />
</apex:form> 
</apex:page>

 

public class PollerTestController 
{
    
    integer m_count = 0; 
    
    public integer RefreshInterval
    {
        get{return 5;}
        set;
    }
    
    public void testAction() 
    { 
        m_count++; 
    } 
    
    public integer Count {get{return m_count;}}
    
}

 The generated JavaScript showing the default 60,000ms pollinterval value:

 

<script type="text/javascript">
A4J.AJAX.Poll('j_id0:j_id1',{'pollId':'j_id0:j_id1:j_id2','similarityGroupingId':'j_id0:j_id1:j_id2','parameters':{'j_id0:j_id1:j_id2':'j_id0:j_id1:j_id2'} ,'pollinterval':60000} );
</script>

 

If I change the ActionPoller to:

 

<apex:actionpoller interval="5" action="{!testAction}" rerender="counter" /> 

 Then I get:

 

<script type="text/javascript">
A4J.AJAX.Poll('j_id0:j_id1',{'pollId':'j_id0:j_id1:j_id2','similarityGroupingId':'j_id0:j_id1:j_id2','parameters':{'j_id0:j_id1:j_id2':'j_id0:j_id1:j_id2'} ,'pollinterval':5000} );
</script>

 Why is the ActionPoller seemingly ignoring the value coming from the property? 

 

NOTE:  I've already tried getter/setter methods instead of the property syntax, at the request of Salesforce Developer Support, since he told me that Apex uses getter/setter and doesn't have property syntax.  Really?  How long have I been writing Apex code? :)   And that doesn't work either.

 

 

 

Hi,

 

I am having problems configuring the email addresses on my UAT users on sandbox, because after you create the sandbox as a configuration mirror of the production all of the users' email have .test appended at the end and even if I try to change their email it does not work because the confirmation is send to the .test email which apperantly is not valid.

 

Any suggestions workaround how people handle this inconvience?

 

Thank you.

 

 

  • March 02, 2011
  • Like
  • 0

Hi all,

 

I have a question is it possible to show visualforce page on the page layout when I hit edit button ? My case is I want to show the visualforce page and standar page layout at the same time on page layout in edit mode. Is is possible to do that? Or maybe there is other suggestions for may case would be great.

 

Thanks

 

Regards,

 

Edwin

How to use two standard controller in one visualforce page?

plz send examples.

Is there any way around so that I can display a Currency Field value with a minus sign if Currency value is negative?

Currently an <apex:inputField> with Currency Field will display a negative amount with brackets around it like this:  ($100.00), I would like to display this value like this: -$100.00

  • October 08, 2009
  • Like
  • 0