3 Replies Latest reply on Aug 3, 2007 6:14 AM by Malte Wiskott

    Dynamicaly loaded selectonemenu in table

    Malte Wiskott Newbie

      Hi,

      I'm want to display a table based on a List of specs

      In this table, I have a selectonemenu which content depends on a value of each row. (The type of spec)

      I tried the following

      <rich:dataTable id="specs" rows="20" var="spec" value="#{modelMgm.specs}">
      
       <h:column>
       <f:facet name="header">Spec:</f:facet>
       <h:outputText value="#{spec.spec.spec}" />
       </h:column>
      
       <h:column>
       <f:facet name="header">Value:</f:facet>
       <h:selectOneMenu value="#{spec.specvalue}" required="false">
       <s:selectItems value="#{specvalueListExt.restrictedList(spec.spec)}" var="spec"
       label="#{spec.valuestr}" noSelectionLabel="Select Spec" />
       <s:convertEntity />
       </h:selectOneMenu>
       </h:column>
      </rich:dataTable>
      


      using the #{specvalueListExt.restrictedList(spec.spec)}

      @Name("specvalueListExt")
      public class SpecvalueListExt extends SpecvalueList {
      
       @Logger Log log ;
      
       public SpecvalueListExt()
       {
       super() ;
       }
      
       public List getRestrictedList(Spec spec)
       {
      // log.info("*************************** Spec: " + spec.getSpec()) ;
       return super.getResultList() ;
       }
      
      }
      


      SpecvalueList extends EntityQuery


      The error I get is now


      SEVERE: Error Rendering View[/modules/models/modelsmanagement.xhtml]
      javax.faces.FacesException: javax.el.ELException: /WEB-INF/facelets/tags/model/editModelSpecs.xhtml @53,65 value="#{specvalueListExt.restrictedList(spec.spec)}": Method not found: ch.is.persistence.ext.SpecvalueListExt@6053c88e.restrictedList(ch.is.persistence.ejb3.Spec_$$_javassist_24)
      </rich:dataTable>


      What am I doing wrong ?
      Or is there a more subtle way to manage this case ?

      Thank you in advance for your remarks

      Sincerely

      Malte

        • 1. Re: Dynamicaly loaded selectonemenu in table
          Malte Wiskott Newbie

          Small Mistake

          <rich:dataTable id="specs" rows="20" var="spec" value="#{modelMgm.specs}">
          
           <h:column>
           <f:facet name="header">Spec:</f:facet>
           <h:outputText value="#{spec.spec.spec}" />
           </h:column>
          
           <h:column>
           <f:facet name="header">Value:</f:facet>
           <h:selectOneMenu value="#{spec.specvalue}" required="false">
           <s:selectItems value="#{specvalueListExt.restrictedList(spec.spec)}" var="specChoice"
           label="#{specChoice.valuestr}" noSelectionLabel="Select Spec" />
           <s:convertEntity />
           </h:selectOneMenu>
           </h:column>
          </rich:dataTable>
          


          • 2. Re: Dynamicaly loaded selectonemenu in table
            Pete Muir Master

            Try

            <rich:dataTable id="specs" rows="20" var="spec" value="#{modelMgm.specs}">
            
             <h:column>
             <f:facet name="header">Spec:</f:facet>
             <h:outputText value="#{spec.spec.spec}" />
             </h:column>
            
             <h:column>
             <f:facet name="header">Value:</f:facet>
             <h:selectOneMenu value="#{spec.specvalue}" required="false">
             <s:selectItems value="#{specvalueListExt.getRestrictedList(spec.spec)}" var="specChoice"
             label="#{specChoice.valuestr}" noSelectionLabel="Select Spec" />
             <s:convertEntity />
             </h:selectOneMenu>
             </h:column>
            </rich:dataTable>
            


            (read the docs)

            • 3. Re: Dynamicaly loaded selectonemenu in table
              Malte Wiskott Newbie

              Hi Pete,

              Sorry for my question ...
              And thank you for pointing me in the right direction.

              It was so obvious that I didn't see it.


              Bye

              Malte