+ Start a Discussion
Iceman123Iceman123 

actionFunction works in IE but not Firefox?

Given the same VF page and Apex controller using a very simple example invoking the actionFunction, I am seeing that it works only in IE and not in Firefox.


The controller code:

public class TestAction {

public String ExposeID { get; set; }

public PageReference toggleItem()
{
ExposeID = Apexpages.currentPage().getParameters().get('firstParam');
system.debug('~~~~~~~~~ IN TOGGLE ITEM');

return null;
}


}

The page code:

<apex:page controller="TestAction" tabStyle="Account" sidebar="false">
<apex:form >

<a href="/apex/TestActionPage?expose=12" onclick="toggleItemJS('12');">Item 12</a>

<apex:actionFunction action="{!toggleItem}" name="toggleItemJS" rerender="showstate" >
<apex:param name="firstParam" assignTo="{!ExposeID}" value="" />
</apex:actionFunction>

<p><apex:outputText value="Item Exposed: {!ExposeID}" id="showstate" /></p>
</apex:form>

</apex:page>



When using IE as the client browser, the debug window shows:

 

------------------------------------------------------------------------

 

10:05:37 DEBUG -
***Begining Page Log for /apex/TestActionPage
Cumulative profiling information:

No profiling information for SOQL operations.

No profiling information for SOSL operations.

No profiling information for DML operations.

No profiling information for method invocations.


***Ending Page Log for /apex/TestActionPage?expose=12
10:05:37 DEBUG -
***Begining Page Log for /apex/TestActionPage
Cumulative profiling information:

No profiling information for SOQL operations.

No profiling information for SOSL operations.

No profiling information for DML operations.

No profiling information for method invocations.


***Ending Page Log for /apex/TestActionPage?expose=12
10:05:38 DEBUG -
***Begining Page Log for /apex/TestActionPage
20100107180537.295:Class.TestAction.toggleItem: line 8, column 8: ~~~~~~~~~ IN TOGGLE ITEM
20100107180537.295:External entry point: returning NULL from method public System.PageReference toggleItem() in 0 ms

Element j_id3 called method {!toggleItem} returned type PageReference: noneCumulative profiling information:

No profiling information for SOQL operations.

No profiling information for SOSL operations.

No profiling information for DML operations.

1 most expensive method invocations:
Class.TestAction: line 5, column 23: public System.PageReference toggleItem(): executed 1 time in 0 ms


***Ending Page Log for /apex/TestActionPage?expose=12
10:05:38 DEBUG -
***Begining Page Log for /apex/TestActionPage
20100107180537.295:Class.TestAction.toggleItem: line 8, column 8: ~~~~~~~~~ IN TOGGLE ITEM
20100107180537.295:External entry point: returning NULL from method public System.PageReference toggleItem() in 0 ms

Element j_id3 called method {!toggleItem} returned type PageReference: noneCumulative profiling information:

No profiling information for SOQL operations.

No profiling information for SOSL operations.

No profiling information for DML operations.

1 most expensive method invocations:
Class.TestAction: line 5, column 23: public System.PageReference toggleItem(): executed 1 time in 0 ms


***Ending Page Log for /apex/TestActionPage?expose=12


------------------------------------------------------------------------
As you can see, it called the toggleItem function correctly.

But when I use a Firefox browser (tried 2.0 , 3.0 and 3.5), it only writes:

10:04:50 DEBUG - ***Begining Page Log for /apex/TestActionPage Cumulative profiling information: No profiling information for SOQL operations. No profiling information for SOSL operations. No profiling information for DML operations. No profiling information for method invocations. ***Ending Page Log for /apex/TestActionPage?expose=12

It did not invoke the toggleItem function at all.

Does anyone know what could be the problem?

thanks,
Pi

Best Answer chosen by Admin (Salesforce Developers) 
Iceman123Iceman123
Turns out I was watching the System Log window's Apex Code Debug printouts as the code executed.  The debug logs under Monitoring do print out the method invocation when using Firefox, so this looks like a bug in the System Log dialog windows for Firefox, or there are additional steps to get the full stack printed in the System Log window when using Firefox.
Message Edited by Iceman123 on 01-13-2010 05:48 PM

All Answers

David VPDavid VP

I would try using a commandLink tag instead of the regular href tag ...

Iceman123Iceman123
Turns out I was watching the System Log window's Apex Code Debug printouts as the code executed.  The debug logs under Monitoring do print out the method invocation when using Firefox, so this looks like a bug in the System Log dialog windows for Firefox, or there are additional steps to get the full stack printed in the System Log window when using Firefox.
Message Edited by Iceman123 on 01-13-2010 05:48 PM
This was selected as the best answer