0 Replies Latest reply on Jul 9, 2008 6:14 AM by Peter Whitmore

    problem with a4j:ouputpanel and ie7

    Peter Whitmore Newbie

      Hi,

      I think there is a bug in the ajax ouputpanel when used in conjunction with ie(7 in my case).

      I am using
      -JBoss 4.2.2
      -Ricfaces 3.2.1
      -Seam 2.0.3
      -ie 7.0
      -firefox 3.0


      It has to be said that although i have a lot of java and standard ee experience, I'm relatively new to all this web-app stuff. ;-)

      I have run into a problem with ie7 and the ajax outputpanel.

      I have a selectOneMenu inside an ajax form which (inside the outputpanel) which fires submit on the change event. when running in firefox it runs fine, but ie 7.0 will bring up the error dialog. This only happns when ajaxRendered is set to true on the outputpanel.

      My aim is to set the focus to a designated element after the change and submit are finished processing.

      In my real code I am also doing some re-rendering which won't be called if the ajaxRendered is set to false.

      Below is a simple example snipet I used to reproduce the problem:

      <a4j:outputPanel ajaxRendered="true">
       <a4j:form id="me" ajaxSubmit="true" ajaxSingle="true">
       <h:selectOneMenu id="my" value="1" onchange="submit(); alert('hi')">
       <f:selectItem itemLabel="1" itemValue="1" />
       <f:selectItem itemLabel="10" itemValue="10" />
       <f:selectItem itemLabel="20" itemValue="20" />
       <a4j:support event="onchange" focus="myTxt"></a4j:support>
       </h:selectOneMenu>
       <h:inputText id="myTxt" />
      
      
       </a4j:form>
       </a4j:outputPanel>
      




      Finally and I hate mixing questions with problems but how would I set the focus to an element after it was rerendered to visible based on the value being changed in the selectOneMenu. The above focus="myTxt" doesn't seem to work and the javascript solution of getting element by id is called to early and therefore returns null.

      Thanks in advance.

      Peter.