Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-1355

Incorrect behaviour of a4j:htmlCommandLink

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Cannot Reproduce Bug
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.1.4, 3.2.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Win XP, FF2, IE6

      Description

      a4j:htmlCommandLink makes hidden input. Than it is doesn't remove this hidden input, because Action from previous a4j:htmlCommandLink is called.

        Gliffy Diagrams

          Activity

          Hide
          stroyanov Troyanoff Slava added a comment -

          <code>
          <h:panelGrid columns="1" style="padding-top: 5px;">
          <c:forEach items="#

          {report.drilldowns}

          " var="item" varStatus="stat">
          <a4j:htmlCommandLink
          id="dditem#

          {tabId}_#{stat.index}" styleClass="tooltip_repStyle"
          oncomplete="var rez = processRow(event||window.event,'mainForm:drilldowns#{tabId}

          '); if(!rez) return rez;"
          action="#

          {reportsBean.openReport}

          ">
          <a4j:actionparam assignTo="#

          {reportsBean.reportForProcess}

          " name="reportForLoad" value="#

          {item.reportId}

          " />
          <a4j:actionparam assignTo="#

          {reportsBean.currentTabIndex}

          " name="currentTabIndex" value="#

          {index}

          " />
          <a4j:actionparam assignTo="#

          {reportsBean.currentDrilldownName}

          " name="currentDrilldownName" value="#

          {item.drilldownName}" />
          <h:outputText value="#{item.drilldownName}

          " />
          </a4j:htmlCommandLink>
          </c:forEach>
          <c:if test="#

          {report.reportPackAvailable}

          ">
          <a4j:htmlCommandLink onclick="hideTooltip('mainForm:drilldowns#

          {tabId}

          '); prepareDrilldownInfo();" styleClass="tooltip_repStyle"
          action="#

          {reportsBean.getDataForExcelReportPack}

          ">
          <h:outputText value="#

          {msg.reportPack}

          "></h:outputText>
          </a4j:htmlCommandLink>
          </c:if>
          </h:panelGrid>
          <code>

          Show
          stroyanov Troyanoff Slava added a comment - <code> <h:panelGrid columns="1" style="padding-top: 5px;"> <c:forEach items="# {report.drilldowns} " var="item" varStatus="stat"> <a4j:htmlCommandLink id="dditem# {tabId}_#{stat.index}" styleClass="tooltip_repStyle" oncomplete="var rez = processRow(event||window.event,'mainForm:drilldowns#{tabId} '); if(!rez) return rez;" action="# {reportsBean.openReport} "> <a4j:actionparam assignTo="# {reportsBean.reportForProcess} " name="reportForLoad" value="# {item.reportId} " /> <a4j:actionparam assignTo="# {reportsBean.currentTabIndex} " name="currentTabIndex" value="# {index} " /> <a4j:actionparam assignTo="# {reportsBean.currentDrilldownName} " name="currentDrilldownName" value="# {item.drilldownName}" /> <h:outputText value="#{item.drilldownName} " /> </a4j:htmlCommandLink> </c:forEach> <c:if test="# {report.reportPackAvailable} "> <a4j:htmlCommandLink onclick="hideTooltip('mainForm:drilldowns# {tabId} '); prepareDrilldownInfo();" styleClass="tooltip_repStyle" action="# {reportsBean.getDataForExcelReportPack} "> <h:outputText value="# {msg.reportPack} "></h:outputText> </a4j:htmlCommandLink> </c:if> </h:panelGrid> <code>
          Hide
          stroyanov Troyanoff Slava added a comment -

          See code above. Firstly we call a4j:htmlCommandLink and excel's document is created. Than we call one report from a4j:commandLink and report isn't opened.

          Show
          stroyanov Troyanoff Slava added a comment - See code above. Firstly we call a4j:htmlCommandLink and excel's document is created. Than we call one report from a4j:commandLink and report isn't opened.
          Hide
          stroyanov Troyanoff Slava added a comment -

          Valid code
          <code>

          <h:panelGrid columns="1" style="padding-top: 5px;">
          <c:forEach items="#

          {report.drilldowns}

          " var="item" varStatus="stat">
          <a4j:commandLink
          id="dditem#

          {tabId}_#{stat.index}" styleClass="tooltip_repStyle"
          oncomplete="var rez = processRow(event||window.event,'mainForm:drilldowns#{tabId}

          '); if(!rez) return rez;"
          action="#

          {reportsBean.openReport}

          ">
          <a4j:actionparam assignTo="#

          {reportsBean.reportForProcess}

          " name="reportForLoad" value="#

          {item.reportId}

          " />
          <a4j:actionparam assignTo="#

          {reportsBean.currentTabIndex}

          " name="currentTabIndex" value="#

          {index}

          " />
          <a4j:actionparam assignTo="#

          {reportsBean.currentDrilldownName}

          " name="currentDrilldownName" value="#

          {item.drilldownName}" />
          <h:outputText value="#{item.drilldownName}

          " />
          </a4j:commandLink>
          </c:forEach>
          <c:if test="#

          {report.reportPackAvailable}

          ">
          <a4j:htmlCommandLink onclick="hideTooltip('mainForm:drilldowns#

          {tabId}

          '); prepareDrilldownInfo();" styleClass="tooltip_repStyle"
          action="#

          {reportsBean.getDataForExcelReportPack}

          ">
          <h:outputText value="#

          {msg.reportPack}

          "></h:outputText>
          </a4j:htmlCommandLink>
          </c:if>
          </h:panelGrid>

          </code>

          Show
          stroyanov Troyanoff Slava added a comment - Valid code <code> <h:panelGrid columns="1" style="padding-top: 5px;"> <c:forEach items="# {report.drilldowns} " var="item" varStatus="stat"> <a4j:commandLink id="dditem# {tabId}_#{stat.index}" styleClass="tooltip_repStyle" oncomplete="var rez = processRow(event||window.event,'mainForm:drilldowns#{tabId} '); if(!rez) return rez;" action="# {reportsBean.openReport} "> <a4j:actionparam assignTo="# {reportsBean.reportForProcess} " name="reportForLoad" value="# {item.reportId} " /> <a4j:actionparam assignTo="# {reportsBean.currentTabIndex} " name="currentTabIndex" value="# {index} " /> <a4j:actionparam assignTo="# {reportsBean.currentDrilldownName} " name="currentDrilldownName" value="# {item.drilldownName}" /> <h:outputText value="#{item.drilldownName} " /> </a4j:commandLink> </c:forEach> <c:if test="# {report.reportPackAvailable} "> <a4j:htmlCommandLink onclick="hideTooltip('mainForm:drilldowns# {tabId} '); prepareDrilldownInfo();" styleClass="tooltip_repStyle" action="# {reportsBean.getDataForExcelReportPack} "> <h:outputText value="# {msg.reportPack} "></h:outputText> </a4j:htmlCommandLink> </c:if> </h:panelGrid> </code>
          Hide
          a.izobov Andrey Izobov added a comment -

          still reproduced (RichFaces 3.1.4)

          Show
          a.izobov Andrey Izobov added a comment - still reproduced (RichFaces 3.1.4)
          Hide
          sergeyhalipov Sergey Halipov added a comment -

          Seems to work fine with both 3.1.4 and 3.2.0.
          JSP:
          <a4j:form id="form2">
          <a4j:htmlCommandLink action="#

          {bean.firstAction}

          " value="First" target="_blank" /><br>
          <a4j:htmlCommandLink action="#

          {bean.secondAction}

          " value="Second" target="_blank" />
          </a4j:form>

          Java:
          public String firstAction()

          { System.out.println("firstAction()"); return null; }

          public String secondAction()

          { System.out.println("secondAction()"); return null; }

          BTW. Which JSF version are you using? It is similar to http://jira.jboss.com/jira/browse/RF-1099

          Show
          sergeyhalipov Sergey Halipov added a comment - Seems to work fine with both 3.1.4 and 3.2.0. JSP: <a4j:form id="form2"> <a4j:htmlCommandLink action="# {bean.firstAction} " value="First" target="_blank" /><br> <a4j:htmlCommandLink action="# {bean.secondAction} " value="Second" target="_blank" /> </a4j:form> Java: public String firstAction() { System.out.println("firstAction()"); return null; } public String secondAction() { System.out.println("secondAction()"); return null; } BTW. Which JSF version are you using? It is similar to http://jira.jboss.com/jira/browse/RF-1099
          Hide
          maksimkaszynski Maksim Kaszynski added a comment -

          Now works without a4j:form as well

          Show
          maksimkaszynski Maksim Kaszynski added a comment - Now works without a4j:form as well

            People

            • Assignee:
              viktor_volkov Viktor Volkov
              Reporter:
              stroyanov Troyanoff Slava
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development