1 Reply Latest reply on Nov 6, 2007 7:04 PM by Stoigniew Sztank

    rich:togglePanel within dataTable

    Matthias Gladt Newbie

      Is it possible to use togglePanel within a dataTable?
      I have

       <h:dataTable value="#{test.data}" var="row">
       <rich:togglePanel switchType="client" initialState="f1#{row.id}"
       <f:facet name="f1#{row.id}">
       <rich:toggleControl switchToState="f2#{row.id}">
       <h:outputText value="switch to 2" />
       <h:outputText value="#{row.test1}" />
       <f:facet name="f2#{row.id}">
       <rich:toggleControl switchToState="f1#{row.id}">
       <h:outputText value="switch to 1" />
       <h:outputText value="#{row.test2}" />

      and the bean:
      import java.util.ArrayList;
      import java.util.Collection;
      import java.util.HashMap;
      import java.util.List;
      import java.util.Map;
      import org.jboss.seam.annotations.Logger;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.log.Log;
      public class Test {
       private static Log log;
       public Collection<Map<String, String>> getData() {
       List<Map<String, String>> data = new ArrayList<Map<String, String>>();
       Map<String, String> m = new HashMap<String, String>();
       m.put("test1", "test 1");
       m.put("test2", "test 2");
       m.put("id", "1");
       m = new HashMap<String, String>();
       m.put("test1", "test A");
       m.put("test2", "test B");
       m.put("id", "2");
       return data;

      and get "Facet with name: f11 not found!"
      Do I make a mistake here?

        • 1. Re: rich:togglePanel within dataTable
          Stoigniew Sztank Newbie

          I also have a problem with togglePanel within dataTable.

          <rich:column >
           <a4j:region renderRegionOnly="true">
           <rich:togglePanel id="panel" stateOrder="display,edit" switchType="ajax" >
           <f:facet name="display">
           <h:panelGrid columns="1" cellpadding="0" cellspacing="0">
           <h:outputText value="aaa" />
           <rich:toggleControl value="Edytuj" reRender="panel" />
           <f:facet name="edit">
           <h:panelGrid columns="1" cellpadding="0" cellspacing="0">
           <h:inputTextarea value="bbb">
           <rich:toggleControl value="Zapisz" reRender="panel" />

          This code works ok outside the dataTable but not inside. It also works when setting swithType="client" it. I'me porting the code from jboss-seam 1.2 to jboss-seam 2.0. In jboss-seam 1.2 this works but not always:/