4 Replies Latest reply on Oct 13, 2008 1:28 PM by antoine_h

    commandLink / firefox 3 and 2 / works only after button clic

    antoine_h

      Hi,

      I use a form, and a commandLink inside it (with a param).
      AjaxSubmit is false.

      on firefox 3 (and 2), the link does not work, but if I click on any button (or dataScroller) of the page, then the link starts to work properly.
      the action method is called, the rendering is called... with the proper values, but nothing change on the page (the table is not showing the new ordered values, etc...)
      it looks like that the result is not sent to the navigator. why is it sent, only after one "other" submit of the form ?

      on IE 6, no problem, the link always function.

      I tried the htmlCommandLink, and of course, it works... but not anymore ajax.

      any idea why it works only after a click of a button (form submit) ?

      is it a bug ? do I write a JIRA ?

      Thanks for any help or confirmation...

        • 1. Re: commandLink / firefox 3 and 2 / works only after button
          antoine_h

          I checked with the phase tracker, there are two rendering phase happening.

          one with the new value, one with the former values.

          there is a second Phase 1 restore_view, and a second phase 6 for rendering.

          it seems that there is two ajax requests...

          any idea about that ?
          a bug ?

          thanks

          • 2. Re: commandLink / firefox 3 and 2 / works only after button
            antoine_h

            also, after the click of a button of the form, then it work properly.

            but there are two request : one with no action method called, and the second with the action method... that renders properly...

            • 3. Re: commandLink / firefox 3 and 2 / works only after button
              ilya_shaikovsky

              please add some actual code snippets. It isn't clear without them.

              • 4. Re: commandLink / firefox 3 and 2 / works only after button
                antoine_h

                ok

                the xhtml file is :


                <html xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:h="http://java.sun.com/jsf/html"
                 xmlns:f="http://java.sun.com/jsf/core"
                 xmlns:a4j="http://richfaces.org/a4j"
                 xmlns:rich="http://richfaces.org/rich">
                <ui:composition>
                
                 <a4j:outputPanel ajaxRendered="true">
                
                 <h:outputText styleClass="portlet-form-label"
                 value="Workshop, The search of DataInfo Entity : #{dataInfoSearchStdBKBPortDtInfoMainRef.elementMOClass.simpleName}.">
                 </h:outputText>
                
                 <a4j:region id="dataInfo_SearchView_PortMainRef_Std_Region">
                
                 <rich:messages></rich:messages>
                
                 <a4j:form id="dataInfo_SearchView_PortMainRef_Std">
                 <a4j:outputPanel id="searchCriteriaPanel" layout="block">
                
                 <h:panelGrid columns="3" width="100%">
                 <h:outputText value="Country :" />
                 <h:outputText value="Country Subdivision :" />
                 <h:outputText value="Sea :" />
                 <h:inputText id="fld_crit_country" label="Country"
                 value="nothing now" maxlength="20" size="20" required="false">
                 </h:inputText>
                 <h:inputText id="fld_crit_countrySubdivision"
                 label="Country Subdivision" value="nothing now" maxlength="20"
                 size="20" required="false">
                 </h:inputText>
                 <h:inputText id="fld_crit_sea" label="Sea" value="nothing now"
                 maxlength="20" size="20" required="false">
                 </h:inputText>
                 </h:panelGrid>
                 <h:panelGrid columns="1" width="100%">
                 <f:facet name="footer">
                 <h:outputText value="Choose one or several criteria."
                 styleClass="portlet-msg-info" />
                 </f:facet>
                
                 <h:outputText value="Port usual name :" />
                 <!-- Put the inputText here -->
                 <h:inputText id="fld_crit_PortCode" label="Port usual name"
                 value="#{dataInfoSearchStdBKBPortDtInfoMainRef.filtersVoMgr['filtIdCode'].value}"
                 maxlength="30" size="30" required="false">
                 </h:inputText>
                
                 </h:panelGrid>
                 <rich:spacer width="93%" height="12" />
                
                 <a4j:commandButton value="Find"
                 action="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrDtIteration.resetToStartView}"
                 ajaxSingle="false" title="Find the data."
                 styleClass="portlet-form-button-asLink">
                 <f:param name="actNav" value="" />
                 </a4j:commandButton>
                 </a4j:outputPanel>
                
                 <rich:spacer width="93%" height="20" />
                
                
                 <h:inputText id="orderStateCurrent_table" label="orderStateCurrent"
                 value="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrOrder1.orderStateCurrent}"
                 size="30" required="false">
                 </h:inputText>
                
                 <rich:dataTable id="tableView_SearchResult_Std"
                 value="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrDtIteration.dataModel}"
                 var="varItem_main" rows="10" align="center" width="95%" columns="7"
                 onRowMouseOver="this.style.backgroundColor='#F8F8F8'"
                 onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
                 <!--
                 columns="#{dataInfoSearchStdBKBPortDtInfoMainRef.columnToViewDefListBaseDataSize}"
                 first="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrDtIteration.first}"
                 -->
                 <f:facet name="header">
                 <rich:columnGroup>
                 <f:facet name="header">
                 <h:outputText styleClass="headerText" value="Name" />
                 </f:facet>
                 </rich:columnGroup>
                 </f:facet>
                
                 <rich:column id="idDB">
                 <f:facet name="header">
                 <a4j:commandLink value="Id-DB" id="order_cmdhlk_IdDB"
                 action="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrOrder1.switchOrderState}">
                 <a4j:actionparam name="orderStateNew"
                 value="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrOrder1.stateNew['id']}" />
                 <img class="sty_w_img_icon_plain_tiny"
                 src="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrOrder1.imageURIs['id']}?quiet=true" />
                 </a4j:commandLink>
                 </f:facet>
                 <h:outputText value="#{varItem_main.id}" />
                 </rich:column>
                 <rich:column id="idCode">
                 <f:facet name="header">
                 <a4j:commandLink value="Code" id="order_cmdhlk_idCode"
                 action="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrOrder1.switchOrderState}">
                 <a4j:actionparam name="orderStateNew"
                 value="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrOrder1.stateNew['commonInfo.idCode']}" />
                 <img class="sty_w_img_icon_plain_tiny"
                 src="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrOrder1.imageURIs['commonInfo.idCode']}?quiet=true" />
                 </a4j:commandLink>
                 </f:facet>
                 <h:outputText value="#{varItem_main.commonInfo.idCode}" />
                 </rich:column>
                 <rich:column id="name">
                 <f:facet name="header">
                 <a4j:commandLink value="Name" id="order_cmdhlk_name"
                 action="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrOrder1.switchOrderState}">
                 <a4j:actionparam name="orderStateNew"
                 value="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrOrder1.stateNew['commonInfo.name']}" />
                 <img class="sty_w_img_icon_plain_tiny"
                 src="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrOrder1.imageURIs['commonInfo.name']}?quiet=true" />
                 </a4j:commandLink>
                 </f:facet>
                 <h:outputText value="#{varItem_main.commonInfo.name}" />
                 </rich:column>
                
                 <rich:column id="countryInfo">
                 <f:facet name="header">
                 <a4j:commandLink value="Country / Subdivision"
                 id="order_cmdhlk_CountrySubdiv"
                 action="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrOrder1.switchOrderState}">
                 <a4j:actionparam name="orderStateNew"
                 value="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrOrder1.stateNew['commonInfo.dtRefCountry.name']}" />
                 <img class="sty_w_img_icon_plain_tiny"
                 src="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrOrder1.imageURIs['commonInfo.dtRefCountry.name']}?quiet=true" />
                 </a4j:commandLink>
                 </f:facet>
                 <h:outputText
                 value="#{varItem_main.dtRefCountry.name}(#{varItem_main.dtRefCountry.idCode})" />
                 <h:outputText
                 rendered="#{varItem_main.dtRefCountrySubdivisionNotEmpty}"
                 value=" / #{varItem_main.dtRefCountrySubdivision.name}(#{varItem_main.dtRefCountrySubdivision.idCode})" />
                 </rich:column>
                
                 <rich:column id="ContinentSubdivInfo" rendered="true">
                 <f:facet name="header">
                 <a4j:commandLink value="Continent Subdivision"
                 id="order_cmdhlk_ContinentSubdiv"
                 action="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrOrder1.switchOrderState}">
                 <a4j:actionparam name="orderStateNew"
                 value="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrOrder1.stateNew['commonInfo.dtRefCountry.dtRefContinentSubdivision.name']}" />
                 <img class="sty_w_img_icon_plain_tiny"
                 src="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrOrder1.imageURIs['commonInfo.dtRefCountry.dtRefContinentSubdivision.name']}?quiet=true" />
                 </a4j:commandLink>
                 </f:facet>
                 <h:outputText
                 value="#{varItem_main.dtRefContinentSubdivision.name}(#{varItem_main.dtRefContinentSubdivision.idCode})" />
                 </rich:column>
                
                 <!--
                 <rich:column id="idCode">
                 <f:facet name="header">
                 <h:outputText styleClass="headerText" value="Code" />
                 </f:facet>
                 <h:outputText value="#{varItem_main.idCode}"></h:outputText>
                 </rich:column>
                 -->
                
                 <rich:column id="action_view_detail">
                 <f:facet name="header">
                 <h:outputText styleClass="headerText" value="View Detail" />
                 </f:facet>
                 <a4j:commandLink
                 action="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewStandardDtRefRecord}"
                 title="View the details and modify the entity.">
                 <h:outputText value="Details" />
                 <f:param name="actNav" value="viewStd_DTRefRecord" />
                 <f:param name="currentEntityClass"
                 value="#{dataRefMngtBKBMain.currentEntityClassFromSelectedItem}" />
                 <f:param name="curEntToMngId" value="#{varItem_main.id}" />
                 </a4j:commandLink>
                
                 <h:outputText value=" | " />
                
                 <a4j:commandLink
                 action="#{dataInfoSearchStdBKBPortDtInfoMainRef.deleteEntityMO}"
                 title="Delete this entity."
                 onclick="if (!confirm('Are you sure you want to delete this record ?')) return false">
                 <h:outputText value="Delete" />
                 <f:param name="actNav" value="delete_DTRefRecord" />
                 <f:param name="currentEntityClass"
                 value="#{dataRefMngtBKBMain.currentEntityClassFromSelectedItem}" />
                 <f:param name="curEntToMngId" value="#{varItem_main.id}" />
                 </a4j:commandLink>
                 </rich:column>
                 </rich:dataTable>
                
                 <rich:spacer width="93%" height="20" />
                 <rich:datascroller id="tableView_SearchResult_Std_Scroller"
                 align="center" for="tableView_SearchResult_Std" maxPages="10"
                 page="#{dataInfoSearchStdBKBPortDtInfoMainRef.viewMgrDtIteration.scrollerPage}"
                 ajaxSingle="false" />
                
                 <rich:spacer width="93%" height="20" />
                
                 <h:panelGroup layout="block"
                 styleClass="portlet-form-button-envelop">
                
                 <a4j:commandLink value="Add a new Port"
                 action="#{dataInfoSearchStdBKBPortDtInfoMainRef.newEntityMO}"
                 title="Add a new Port." styleClass="portlet-form-button-asLink">
                 <f:param name="actNav" value="actNewEntity" />
                 <f:param name="currentEntityClass"
                 value="#{dataInfoSearchStdBKBPortDtInfoMainRef.elementMOClass.name}" />
                 </a4j:commandLink>
                 <a4j:commandLink immediate="true"
                 action="#{dataInfoSearchStdBKBPortDtInfoMainRef.getActionNavFromReqParam}"
                 title="Cancel and go back."
                 styleClass="portlet-form-button-asLink">
                 <h:outputText value="Go back" />
                 <f:param name="actNav" value="goBack" />
                 </a4j:commandLink>
                 </h:panelGroup>
                 <rich:spacer width="93%" height="20" />
                 </a4j:form>
                
                 </a4j:region>
                
                 </a4j:outputPanel>
                </ui:composition>
                </html>
                

                The "<a4j:commandLink value="Id-DB" id="order_cmdhlk_IdDB ..."
                is one of the commandLink that does not behave properly.

                there is a first part with the search controls, a button "find", then under a dataTable, with the ordering link on the header name of each column.

                between them, there is an input field, that will be later hidden, that store the current order state.

                the whole thing is (and must be) stateless and beans are request scope.

                ***********
                I had done a more simple example, ... the same problem.
                I will look if it is still working and can post it also if you think it is better.

                Thanks a lot,