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">
       <h:column>
       <rich:togglePanel switchType="client" initialState="f1#{row.id}"
       stateOrder="f1#{row.id},f2#{row.id}">
       <f:facet name="f1#{row.id}">
       <h:panelGroup>
       <rich:toggleControl switchToState="f2#{row.id}">
       <h:outputText value="switch to 2" />
       </rich:toggleControl>
       <h:outputText value="#{row.test1}" />
       </h:panelGroup>
       </f:facet>
       <f:facet name="f2#{row.id}">
       <h:panelGroup>
       <rich:toggleControl switchToState="f1#{row.id}">
       <h:outputText value="switch to 1" />
       </rich:toggleControl>
       <h:outputText value="#{row.test2}" />
       </h:panelGroup>
       </f:facet>
       </rich:togglePanel>
       </h:column>
       </h:dataTable>
      

      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;
      
      @Name("test")
      public class Test {
      
       @Logger
       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");
       data.add(m);
       m = new HashMap<String, String>();
       m.put("test1", "test A");
       m.put("test2", "test B");
       m.put("id", "2");
       data.add(m);
       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

          Hi
          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" />
           </h:panelGrid>
           </f:facet>
           <f:facet name="edit">
           <h:panelGrid columns="1" cellpadding="0" cellspacing="0">
           <h:inputTextarea value="bbb">
           </h:inputTextarea>
           <rich:toggleControl value="Zapisz" reRender="panel" />
           </h:panelGrid>
           </f:facet>
           </rich:togglePanel>
           </a4j:region>
           </rich:column>
          ..
          


          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:/