1 Reply Latest reply on Apr 27, 2008 3:00 PM by Ken Clark

    commandButton not working in Clickable List

    Ken Clark Newbie

      I have a facelet page in which I have put together a clickable list.  The problem is, the commandButton actions do not seem to get called when the button is clicked.

      Anyone know what the problem might be?

      Note: I can change the action EL to anything I want, and it does not complain when there is no real managed bean that matches the EL.  It just redraws the page without seemingly calling any model code at all.

      Here is the facelet code:

      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
          <ui:define name="body">
              <h:messages globalOnly="true" styleClass="message"/>
              <ice:form id="selectVersionForm">
                  <ice:panelGrid id="homePanelGrid" columns="1" columnClasses="leftMenu,leftMenu">
                      <ice:panelGroup id="homePanelGroup">
                              <h:outputText value="List of Versions for Product "/>
                              <h:outputText value="#{versionAction.topNodeId}"/>
                          <h:dataTable value='#{versions}' var='version' border="1"
                                       cellpadding="2" cellspacing="0">
                                  <f:facet name="header">
                                      <h:outputText value="Version Title"/>
                                  <h:outputText id="versionTitle" value="#{version.versionTitle}"/>
                                  <f:facet name="header">
                                      <h:outputText value="Release Type"/>
                                  <h:outputText value="#{version.releaseType.releaseTypeDesc}"/>
                                  <f:facet name="header">
                                      <h:outputText value="Actions"/>
                                  <h:commandButton value="Edit" action="#{versionAction.editVersion}"/>
                                  <f:facet name="header">
                                      <h:outputText value="Delete"/>
                                  <h:commandButton value="Delete" action="#{versionAction.deleteVersion}"/>
                          <s:link id="addVersionLink" 
                                  action="#{versionAction.createVersion}" value="Add New Version">
                              <f:param name="topNodeId" value="#{versionAction.topNodeId}"/>

      some of the action class code:

      public class VersionAction implements VersionActionLocal
          private EntityManager em;
          private Log log;
          @Out(required = false)
          @In(required = false)
          private Version version;
          private List<Version> versions;
          private Version selectedVersion;

      The interface:

      public interface VersionActionLocal {
          public String cancel();
          public String createVersion();
          public String editVersion();
          public Converter getReleaseTypeConverter();
          public Long getTopNodeId ();
          public String listVersions();
          public void remove();
          public String removeVersion();
          public String save();