-
1. Re: searching using selectOneListbox
vata2999 Jun 25, 2011 12:15 AM (in response to jseanjensen)Hi,
Add This to your components.xml
<component class="Region" name="region" /> <component class="InvOrgCode" name="invOrgCode"> <property name="region">#{region}</property> </component>
-
2. Re: searching using selectOneListbox
jseanjensen Jun 27, 2011 12:36 PM (in response to jseanjensen)Thank you for replying.
I've added those to my components.xml and am getting error messages saying that they cannot be resolved to a type.
What would be the purpose of defining these here? Any suggestion on how I can eliminate the error messages?
-
3. Re: searching using selectOneListbox
vata2999 Jun 29, 2011 2:26 AM (in response to jseanjensen)By defining these 2 lines you tell Seam, create a component instance of each Entity and bind it to property of your class which is region , then target is reachable
i guess it's because invOrgCodeList, would you please show the source code of invOrgCodeListDo you have this method in invOrgCodeList ?
InvOrgCode invOrgCode = new InvOrgCode(); public InvOrgCode getInvOrgCode(){ return invOrgCode; }
PS : pay attention to naming convention
-
4. Re: searching using selectOneListbox
jseanjensen Jun 29, 2011 4:54 PM (in response to jseanjensen)I have those methods in my inOrgCodeList.java class as you can see.
@Name("invOrgCodeList") public class InvOrgCodeList extends EntityQuery<InvOrgCode> { private static final String EJBQL = "select invOrgCode from InvOrgCode invOrgCode"; private static final String[] RESTRICTIONS = { "lower(invOrgCode.region.code) like lower(concat(#{invOrgCodeList.invOrgCode.region.code},'%'))", "lower(invOrgCode.orgCode) like lower(concat(#{invOrgCodeList.invOrgCode.orgCode},'%'))", "lower(invOrgCode.title) like lower(concat(#{invOrgCodeList.invOrgCode.title},'%'))", }; private InvOrgCode invOrgCode = new InvOrgCode(); public InvOrgCodeList() { setEjbql(EJBQL); setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS)); setMaxResults(10); } public InvOrgCode getInvOrgCode() { return invOrgCode; } }
I resolved my error (thank you for the hint) and tried this. Although I didn't get any errors I didn't get filtered results either. I'm sure someone has done this successfully but I have no idea where to see an example. Does anyone have an example of a search done with a drop down instead of an inputText?