function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jina ChetiaJina Chetia 

apex:support not working in IE

Hi,

I had implemeted an onchange functionality on a apex:inputField textbox, it worked perfectly fine in Firefox but is not working in IE version 6.0

Here is the piece of code
Code:
<p> <span style="padding :23px;"/> Contract Duration : <span style="padding :12px;"/>
  <apex:outputPanel >
      <apex:inputField id="duration" value="{!contract.ContractTerm}"/><span style="padding:2px;"/><apex:outputLabel value="Months"/>
      <apex:actionSupport event="onchange" action="{!calEndDate}" rerender="endDt"/>
 </apex:outputPanel></p>
  <p> <span style="padding :21px;"/> Contract End Date       :<span style="padding :14px;"/> <apex:outputField id="endDt" value="{!contract.END_DT__c}"/></p>

Controller
 /* This method calculates the End Date depending on the Contract Effective Date 
     and Contract Duration */
    public PageReference calEndDate() 
    {
        Date dat = getContract().StartDate;
        Integer months = getContract().ContractTerm;  
        if(dat != null && months != null)
        {
            contract.END_DT__c = dat.addMonths(months);
           
        }
        
        return null;
    }

Can anyone please help me in solving this?
 Thanks
Jina

dchasmandchasman
apex:actionSupport is a component that is meant to be a direct child of the component that you wish to decorate and you are currently trying to wire up your action to the wrong component apex:outputPanel instead of your apex:inputField. The reason this appears to work in FF is because of a difference in the default event handling mechanism between FF and IE. FF uses bubbling which is allowing the panel to handle the event. Move the apex:actionSupport to be a child of apex;inputField and things should work better for you:

Code:
<p> <span style="padding :23px;"/> Contract Duration : <span style="padding :12px;"/>
  <apex:outputPanel >
      <apex:inputField id="duration" value="{!contract.ContractTerm}"/><span style="padding:2px;"/><apex:outputLabel value="Months">
         <apex:actionSupport event="onchange" action="{!calEndDate}" rerender="endDt"/>
</apex:inputField>
  </apex:outputPanel></p>
<p> <span style="padding :21px;"/> Contract End Date :<span style="padding :14px;"/> <apex:outputField id="endDt" value="{!contract.END_DT__c}"/></p>


 



Message Edited by dchasman on 06-24-2008 09:28 AM
Jina ChetiaJina Chetia
Thanks.It worked :)
jwetzlerjwetzler
Also just a style suggestion, you should remember to use the for attribute on your label and specify your field's id.  This will help keep your page readable by screen readers.