3 Replies Latest reply on May 24, 2011 11:12 AM by Michael Hughes

    Not understanding how to use EJBQL in a regular expression using Seam

    Michael Hughes Newbie

      I'm trying to look for two values within a column using EJBQL and a regular expression using a radio button. I am able to find single values but more than that I'm having problems. My working code for the single values are:

      "personData.status in (#{personSortDataList.statusChoice == 'A' ? "
           + "personSortDataList.statusChoice : null})", 
      "personData.status in (#{bullSortDataList.statusChoice == 'I' ? " 
           + "personSortDataList.statusChoice : null})", 

      The personSortDataList is my session bean, statusChoice is a Character type with a getter and setter, and personData is my entity bean.

      For my main problem, my code that I been trying to make work is:

      "#{personSortDataList.statusChoice == 'B' ? " 
           + "(personData.status in ('A', 'I')) : null}",

      along with several other tries.

      My code from my .xhtml page is:

      <h:selectOneRadio layout="lineDirection" 
           <f:selectItem itemLabel="#{messages['Active']}" itemValue="A" />
           <f:selectItem itemLabel="#{messages['Inactive']}" itemValue="I" />
           <f:selectItem itemLabel="#{messages['Active and Inactive']}" itemValue="B" />

      Any help with this is greatly appreciated!