0 Replies Latest reply on Jun 25, 2009 1:04 AM by nmatrix nmatrix

    Tweaking RESTRICTIONS array in seam-gen component ("<entity>List")

    nmatrix nmatrix Newbie
      Hello Everyone,

      I'm trying to tweaking a component generated by Seam-Gen. I thought I understood the rules of this component but I'm still having problems tweaking the private static final String[] RESTRICTIONS array to search for it's primary key or any numeric type property in the entityList object. For example seam-gen would create this property:

      [code]

             private static final String[] RESTRICTIONS = {
                     "lower(exoshellModules.moduleName) like concat(lower(#{exoshellModulesList.exoshellModules.moduleName
      }),'%')",
                     "lower(exoshellModules.moduleImage) like concat(lower(#{exoshellModulesList.exoshellModules.moduleIma
      ge}),'%')",
                     "lower(exoshellModules.moduleImage) like concat(lower(#{exoshellModulesList.exoshellModules.moduleIma
      ge}),'%')",
                     "lower(exoshellModules.ipAddress) like concat(lower(#{exoshellModulesList.exoshellModules.ipAddress})
      ,'%')",};
           
      [/code]


      and I would add one more property to search moduleId to the array like so below:

      [code]

             private static final String[] RESTRICTIONS = {
                     "lower(exoshellModules.moduleId) like concat(lower(#{exoshellModulesList.exoshellModules.moduleId}),'
      %')",
                     "lower(exoshellModules.moduleName) like concat(lower(#{exoshellModulesList.exoshellModules.moduleName
      }),'%')",
                     "lower(exoshellModules.moduleImage) like concat(lower(#{exoshellModulesList.exoshellModules.moduleIma
      ge}),'%')",
                     "lower(exoshellModules.moduleImage) like concat(lower(#{exoshellModulesList.exoshellModules.moduleIma
      ge}),'%')",
                     "lower(exoshellModules.ipAddress) like concat(lower(#{exoshellModulesList.exoshellModules.ipAddress})
      ,'%')",};
           
      [/code]


      which would end in the error:

      [code]

      javax.faces.FacesException: javax.el.ELException: /admin/ExoshellUserRolesEdit.xhtml @398,126 render
      ed="#{exoshellModulesList.resultList.size() lt 25}": Error reading 'resultList' on type com.domain.seamcms.session.ExoshellModulesList_$$_javassist_279

           at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:393)
           at org.jboss.seam.ui.util.Decoration.hasMessage(Decoration.java:13)
           at org.jboss.seam.ui.util.Decoration.hasMessage(Decoration.java:25)
           at org.jboss.seam.ui.renderkit.DecorateRendererBase.doEncodeBegin(DecorateRendererBase.java:72)
           at org.jboss.seam.ui.util.cdk.RendererBase.encodeBegin(RendererBase.java:79)
           at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
           at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:280)
      ...
      [/code]     



      Any insight or links on how to tweak the RESTRICTIONS array in the List component to include query syntax to search numeric properties or even properties of other objects related to the object component (e.g. object1.object2.property) would be greatly appreciated. I wrote this very late at night so if it does not make any sense, I will attempt to clarify it.

      Thanks,