+ Start a Discussion
irlrobinsirlrobins 

Onchange not working in IE8

Hey all,

 

I have the following chunk of code in a complex VF page:

<apex:dataTable value="{!oi1PricePlans}" width="100%" var="oi1pp" id="oi1pp" rendered="{!renderOi1}">
	<apex:column width="25" styleClass="optionHeight">
		<apex:inputCheckbox id="selectPP1" onclick="deselectOtherOi1(this);calculatePhoneCostOi1({!oi1pp.price}, '{!myOrderItem1.Hardware_Product__r.Name}', '{!oi1pp.smeProductPrice.Price_Plan__r.Name}');calculateMonthlyCostOi1(this,'',{!oi1pp.monthlyCharge},'P');" value="{!oi1pp.selected}">
			<apex:actionSupport event="onchange" action="{!setExtrasAddOnsByPPOI1}" rerender="add_ons_1,extras_1,insurance_1"/>
		</apex:inputCheckbox>
	</apex:column>
	<apex:column styleClass="btext_2">
		{!oi1pp.smeProductPrice.Price_Plan__r.Name}&nbsp;
			<apex:commandLink action="{!setPricePlanDetailsTable}" value="(?)" id="theCommandLink" rel="tooltip" rerender="details" oncomplete="showDetailsDialogPP();" styleClass="see_m_link2" style="font-weight:700;">
				<apex:param assignTo="{!pricePlanId}" value="{!oi1pp.smeProductPrice.Price_Plan__r.id}" name="price_plan_id" />
			</apex:commandLink>
	</apex:column>
	<apex:column width="76" styleClass="b_normal"><strong>€{!oi1pp.monthlyCharge}</strong></apex:column>
</apex:dataTable>

 The object for the data table is a wrapper class, basically consisting of a checkbox, name, price.

 

The desired functionality (which correctly works in IE9 and FF10) is that on selecting one of the checkboxes, the javascript functions should be called using the onclick and then the onchange in the actionsupport rerenders outputpanels that follow the datatable.

 

What happens in IE 8 is that the javascript functions are called on the onclick, but the onchange in the actionsupport doesn't fire until the user has clicked somewhere else on the screen (say a blank area).

 

How can we fix this so it works in IE8? I've tried changing the onchange to onclick and onblur but that doesn't work (the javascript functions failto run properly).

 

Any ideas?

bob_buzzardbob_buzzard

Do you see any javascript errors?  I've found IE8 to be a painful experience with regard to javascript.  One piece of advice from the dojo javascript framework developmentteam helped a lot - set IE7 emulation mode by adding the following to the <head> section:

 

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

 

 

 

irlrobinsirlrobins

No Javascript errors are seen in the console.

 

I'll try the IE7 emulation, but if I force IE9 into IE7 mode using the the F12 developer tool I see the same issues. I.e. having to click off the checkboxes to force the rerender of the outputpanel

irlrobinsirlrobins

Ok think I found a solution to this. I used an actionfunction to create a javascript method to call the controller action and rerender the panels. I then added the call to this javascript method in the onclick so now all the actions are called on a single event (onclick) as opposed to two events (onclick and onchange).

 

Code snip:

<apex:actionFunction name="actionandrerender" action="{!setExtrasAddOnsByPPOI1}" 
    rerender="add_ons_1,extras_1,insurance_1"/>

<apex:inputCheckbox id="selectPP1" onclick="actionandrerender();deselectOtherOi1(this);calculatePhoneCostOi1({!oi1pp.price}, '{!myOrderItem1.Hardware_Product__r.Name}', '{!oi1pp.smeProductPrice.Price_Plan__r.Name}');calculateMonthlyCostOi1(this,'',{!oi1pp.monthlyCharge},'P');" value="{!oi1pp.selected}" />

 

vivekanandanvivekanandan

Hi ,

 

I have a code on command button which will be calling the javascript.
This is the code;

<apex:commandButton value="Generate as PDF"  id="pdfButton" action="{!getselected}" onblur="popup();"></apex:commandButton>

 

The popup function is

function popup()
{
window.open('/apex/CustomerOverviewPDFPage?id={!Account.Id}');
}
</script>

 

This piece of code is working on mozilla but not on other environments. Please help me i nthis.

ve krve kr
Hi,

Once, we click the button, the status field should change to closed and the window needs to be closed automatically.

This is my requirement and I have developed the below javascript code.
 
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}

var qr = sforce.connection.query("SELECT Id, Status FROM Case where Id='" + "{!Case.Id}" + "'");
var records = qr.getArray("records");





var o = new sforce.SObject("Case");
o.id = "{!Case.Id}";


o.Status = "Closed";


sforce.connection.update([o]);

window.parent.close();

It is working in the IE and Chrome but not working in Mozilla.

Any one can give the suggestions to solve this issue or any  other functionality are there in this functionality.

Thank you.