1 Reply Latest reply on Jan 12, 2012 5:17 AM by alrfjb

    a4j:commandLink does not work inside orderingList

    alrfjb

      Hello,  I have a problem with orderingList. Here is my xhtml page: {code}

                                                                                                                           {code}  and this is the bean: {code} package com.lixto.di.ui;  import java.util.ArrayList; import java.util.List;  import javax.ejb.Stateful; import javax.enterprise.context.SessionScoped; import javax.inject.Named;  @Stateful @Named("test") @SessionScoped public class TestBean {      private String text = "";     public String getText() {         return text;     }     public void setText(String text) {         this.text = text;     }     public List getItems() {         List items = new ArrayList();         items.add(new TestItem("item 1"));         items.add(new TestItem("item 2"));         return items;     } } {code}  this does not work. the commandLink is not executed. If I change orderingList to a dataTable everything works as expected. Do I need a converter for the orderingList? If so: why and how should it look like? I already tried to use a converter but it also did not work. Is a commandLink within the orderingList not allowed or did I miss something?  this is the generated tag when using the orderingList (copied with firebug), it looks exactly the same for  both links (including id): {code:xml} show{code}   I'm using RF 4.1.0.final and GF 3.1

        • 1. Re: a4j:commandLink does not work inside orderingList
          alrfjb

          sorry for the post. I tried to format the code with a {code} tag as is recommended in the 'Wiki Markup Help' link but obviously this didn't work. Now trying it with html pre tag...

           

           

          I have a problem with orderingList. Here is my xhtml page:

          <?xml version="1.0" encoding="UTF-8"?>

          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">                                                

          <html xmlns="http://www.w3.org/1999/xhtml"

            xmlns:f="http://java.sun.com/jsf/core"

            xmlns:h="http://java.sun.com/jsf/html"

            xmlns:rich="http://richfaces.org/rich"

            xmlns:a4j="http://richfaces.org/a4j">

           

          <h:head></h:head>

          <h:body>

              <h:form>

                  <rich:orderingList value="#{test.items}" id="items" var="item">

                      <rich:column>

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

                      </rich:column>

                      <rich:column>

                        <a4j:commandLink value="show" render="out" action="#{test.setText(item.description)}" />

                      </rich:column>

                  </rich:orderingList>

              </h:form>

              <a4j:outputPanel id="out">

                  <h:outputText value="Description: #{test.text}"/>

              </a4j:outputPanel>

          </h:body>

          </html>

                                                                            

          and this is the bean:

          package com.lixto.di.ui;
          
          import java.util.ArrayList;
          import java.util.List;
          
          import javax.ejb.Stateful;
          import javax.enterprise.context.SessionScoped;
          import javax.inject.Named;
          
          @Stateful
          @Named("test")
          @SessionScoped
          public class TestBean {
          
              private String text = "";
              public String getText() {
                  return text;
              }
              public void setText(String text) {
                  this.text = text;
              }
              public List getItems() {
                  List items = new ArrayList();
                  items.add(new TestItem("item 1"));
                  items.add(new TestItem("item 2"));
                  return items;
              }
          }
          

          this does not work. the commandLink is not executed. If I change orderingList to a dataTable everything works as expected. Do I need a converter for the orderingList? If so: why and how should it look like? I already tried to use a converter but it also did not work. Is a commandLink within the orderingList not allowed or did I miss something?

           

          I'm using RF 4.1.0.final and GF 3.1