Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-213

commandLink does not work in dataList

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: 1.0.9m9
    • Fix Version/s: 1.1.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Tomcat 5.0, Win2k, JDK 1.4.2_06

      Description

      I've been trying to get a simple commandLink to work in a dataList. I have the dataList bound to a UIData component (binding="#

      {categoryAdmin.ancestorTree}") on the backing bean. It properly displays links. However, when i select the link it fails to call the appropriate action method (action="#{categoryAdmin.ancestor}")and returns back to the page. No error meassages are written to the screen or logs.

      Things i have tried with no success are:

      - placing my backing bean in session rather than request
      - placed <h:messages/> on the jsp to see any error messages (none appear)
      - Debugged the phases in the LifeCycleImpl. It hits all the full LifeCycle phases (restoreView,applyRequestValues,processValidations,updateModelValues,invokeApplication). However, i am not able to determine what is really happening in these phases to result in the outcome.
      - used h:commandLink and x:commandLink (both with session and request backing bean)
      - set a breakpoint in my action method (public String ancestor(){...}) method and it never gets called.

      Following is my page code. I provided the whole page to give context in case there are other conflicts that may be taking place. I'd be happy to provide a small app to reproduce this if my explanation is not enough.

      <%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%>
      <%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h"%>
      <%@ taglib uri="http://myfaces.apache.org/extensions"; prefix="x"%>
      <h:form>

      <x:dataList
      id="ancestorTree"
      var="ancestor"
      binding="#{categoryAdmin.ancestorTree}

      ">
      <x:commandLink action="#

      {categoryAdmin.ancestor}

      " value="#

      {ancestor.title}

      "/>
      </x:dataList>

      <h:commandButton styleClass="buttonnormal"
      action="#

      {categoryAdmin.add}" value="Add Category"/>

      <h:inputHidden id="categoryAdmin_parentCategoryId"
      value="#{categoryAdmin.parentCategoryId}"/>

      <!-- category list -->

      <h:dataTable style="margin: 10px; border: 1px solid black"
      var="category" binding="#{categoryAdmin.categoryTable}">

      <h:column>
      <f:facet name="header">
      <h:outputText value="Title" style="border-bottom: 1px solid black"/>
      </f:facet>
      <h:commandLink action="#{categoryAdmin.child}">
      <h:outputText value="#{category.title}"/>
      </h:commandLink>
      <f:facet name="footer">
      <h:outputText value="" style="border-top: 1px solid black"/>
      </f:facet>
      </h:column>

      <h:column>
      <f:facet name="header">
      <h:outputText value="" style="border-bottom: 1px solid black"/>
      </f:facet>
      <h:commandLink action="#{categoryAdmin.edit}"><h:outputText
      value="Edit"/></h:commandLink>
      <f:facet name="footer">
      <h:outputText value="" style="border-top: 1px solid black"/>
      </f:facet>
      </h:column>

      <h:column>
      <f:facet name="header">
      <h:outputText value="Tree" style="border-bottom: 1px solid black"/>
      </f:facet>
      <h:outputText value="#{category.ancestorTree}"/>
      <f:facet name="footer">
      <h:outputText value="" style="border-top: 1px solid black"/>
      </f:facet>
      </h:column>

      </h:dataTable>

      <h:commandButton styleClass="buttonnormal"
      action="#{categoryAdmin.add}

      " value="Add Category"/>

      </h:form>

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bgoodin Brandon Goodin
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: