+ Start a Discussion
J KeenerJ Keener 

actionSupport issue in IE6

I've developed a Visualforce page that is working fine in Firefox 3 (Where I did all of my testing), but when I run it in IE6, an actionSupport is not working at all.  I've created the following set of code to reproduce the issue that I'm seeing.

Visualforce Page:
Code:
<apex:page controller="TestController1" tabStyle="Account">
  <apex:form >
    <apex:pageBlock title="Test Page Block" id="Test_PageBlock">
        <apex:pageBlockSection columns="1" collapsible="false">
            <apex:facet name="header">
                <apex:outputPanel>
                    <CENTER>
                    <apex:outputText value="Number of Accounts"/>
                    <apex:selectList value="{!Num_Accounts}" size="1" multiselect="false">
                        <apex:selectOptions value="{!Num_Accounts_items}"/>
                    </apex:selectList>
                    <apex:actionSupport event="onchange" rerender="Test_PageBlock" status="status_Test_PageBlock_filtering"/>
                    <apex:actionStatus id="status_Test_PageBlock_filtering" startText=" Requesting..."/>
                    </CENTER>
                </apex:outputPanel>
            </apex:facet>
            <apex:dataTable value="{!Accounts}" var="lines" styleClass="list" id="accountsSection" width="100%">
                <apex:column style="width: 150px" >
                    <apex:facet name="header"><b>Account Name(s)</b></apex:facet>
                    <apex:outputText value="{!lines.Name}"  />
                </apex:column>
            </apex:dataTable>
        </apex:pageBlockSection>
    </apex:pageBlock>
  </apex:form>
</apex:page>

 
Controller:
Code:
public class TestController1 {

    public String Num_Accounts { get; set; }

    public TestController1() {Num_Accounts = '1';}

    public List<SelectOption> getNum_Accounts_items() {
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('1','Top 1 Record'));
        options.add(new SelectOption('2','Top 2 Records'));
        options.add(new SelectOption('3','Top 3 Records'));
        return options;
    }

    public List<Account> getAccounts() {
        List<Account> results;
        if (Num_Accounts == '1') {results = [SELECT Name FROM Account LIMIT 1];}
        if (Num_Accounts == '2') {results = [SELECT Name FROM Account LIMIT 2];}
        if (Num_Accounts == '3') {results = [SELECT Name FROM Account LIMIT 3];}
        return results;
    }
}


Basically, when the picklist value is changed, the PageBlock is supposed to be rerendered and the Account dataTable will reflect the new results.  The actionSupport is doing this correctly in firefox, but in IE6, nothing happens when the picklist is changed.

Does anyone have any idea as to the best approach to get this to work correctly in IE6?  Most of our end users are still using IE6.

Jon Keener
jhkeener@ashland.com
 


Ron HessRon Hess
Try this, with this change it was working for me on IE7, the change is to put the action support inside the select list tag

Code:
                    <apex:selectList value="{!Num_Accounts}" size="1" multiselect="false">
                        <apex:selectOptions value="{!Num_Accounts_items}"/>
                        <apex:actionSupport event="onchange" rerender="Test_PageBlock" status="status_Test_PageBlock_filtering"/>
                        <apex:actionStatus id="status_Test_PageBlock_filtering" startText=" Requesting..."/>
                    </apex:selectList>

 

J KeenerJ Keener
Thanks Ron!  That fixed it in IE6 also!

I did leave the actionStatus outside of the selectList, because when it was inside, it showed up in IE6 before the picklist, even though it was still after the selectOptiions.


Thanks!

Jon Keener
jhkeener@ashland.com