1 Reply Latest reply on Feb 3, 2009 2:18 PM by Sebastian Schießl

    Seam-gen:erated entity web interface: adding fields to the search filter

    Sebastian Schießl Newbie

      Hello out there!


      I am having some issues with my database application/web interface generated with seam-gen.


      My environment:


      Eclipse 3.4.1


      JBossTools 3.0.0.Beta


      Seam 2.1.1.GA




      The problem:


      I reverse-engineered some entities from my database and seam-gen is only generating a search filter with fields for my string-typed columns on the web pages. Now I wanted to add fields to search for an ID, a capacity, load, etc etc..., i.e. for integer, long, double, ... values.
      Setting the respective attribute to its uppercase relative in the entity class didnt quite do the job, I ended up not being able to leave the field empty therefore always having to enter each parameter to view a whole table:


      Client.xhtml:


      ...
      <s:decorate id="clientid" template="layout/display.xhtml">
                  <ui:define name="label">Clientid</ui:define>
                  <h:outputText value="#{clientHome.instance.clientid}"/>
              </s:decorate>
      ...



      ClientList.page.xml:


      ...
      <param name="from"/>
         <param name="clientid" value="#{clientList.client.clientid}"/>
         <param name="company" value="#{clientList.client.company}"/>
      ...



      ClientList.java:


      ...
      private static final String[] RESTRICTIONS = {
                     "to_char(client.clientid) like concat(lower(#{clientList.client.clientid}),'%')", 
      
      ...



      Client.java:


      ...
      @Entity
      @Table(name = "CLIENT", schema = "SCHULUNG")
      public class Client implements java.io.Serializable {
      
           private Long clientid;
      ...


      An empty number search field would produce an empty result page.


      Alhough I really used the search function extensively, I still cannot believe I am the only one experiencing this problem, so if I missed the thread, please point me towards it. Otherwise, any help would be greatly appreciated, I am really stuck here.
      Thanks in advance,
      Sebastian